iOS中 UIActionSheet字体的修改
更新时间:2017年06月19日 11:05:45 作者:弦外雨
这篇文章主要介绍了iOS中 UIActionSheet字体的修改,需要的朋友可以参考下
一,效果图。
二,代码。
RootViewController.h #import <UIKit/UIKit.h> @interface RootViewController : UIViewController <UIActionSheetDelegate> @end RootViewController.m -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UIActionSheet *actionSheet=[[UIActionSheet alloc]initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"手机找回密码", nil]; [actionSheet showInView:self.view]; } #pragma mark - UIActionSheetDelegate - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { switch (buttonIndex) { case 0: { NSLog(@"--0--"); } break; case 1: { NSLog(@"--1--"); } break; default: break; } } - (void)willPresentActionSheet:(UIActionSheet *)actionSheet { for (UIView *subViwe in actionSheet.subviews) { if ([subViwe isKindOfClass:[UIButton class]]) { UIButton *button = (UIButton*)subViwe; button.titleLabel.font=[UIFont systemFontOfSize:15]; [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; } } }
以上所述是小编给大家介绍的iOS中 UIActionSheet字体的修改,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
相关文章
解决iOS7上UITextField限制字数输入导致崩溃问题的方法
这篇文章主要为大家分享了解决iOS7上UITextField限制字数输入导致崩溃问题的方法,感兴趣的小伙伴们可以参考一下2016-03-03详解iOS App开发中改变UIButton内部控件的基本方法
这篇文章主要介绍了iOS App开发中改变UIButton内部控件的基本方法,文章开头也顺带总结了一些UIButton的基本用法,示例代码为Objective-C,需要的朋友可以参考下2016-03-03IOS 七种手势操作(拖动、捏合、旋转、点按、长按、轻扫、自定义)详解及实例代码
这篇文章主要介绍了IOS 七种手势操作(拖动、捏合、旋转、点按、长按、轻扫、自定义)详解及实例代码的相关资料,需要的朋友可以参考下2016-12-12
最新评论