网站首页 软件下载 游戏下载 翻译软件 电子书下载 电影下载 电视剧下载 教程攻略
霍普软件下载网-旗舰软件下载站,将绿色免费商业版破解软件、共享软件、游戏、电影、电视剧一网打尽!
软件 | iOS中 UIActionSheet字体如何修改 |
分类 | 教程攻略-教程-苹果软件教程 |
内容 |
一,效果图。 ![]() 二,代码。 RootViewController.h#import <UIKit/UIKit.h>@interface RootViewController : UIViewController<UIActionSheetDelegate>@endRootViewController.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]; } }} |
随便看 |
|