功能齐全的alert视图
应用介绍
源码HLAlertController,一个非常简洁 但功能齐全的alert 用于替换系统的aler 主要是因为(ios 7 和ios 8的不同 需要调用不同的aler) 非常容易使用 [lang=objc] HLAlertController *alert = [HLAlertController alertControllerWithTitle:@"标题" message:@"副标题 允许换行, 允许换行, 允许换行, 允许换行, 允许换行, 允许换行, 允许换行, 允许换行" preferredStyle:style]; [alert addAction:[HLAlertAction actionWithTitle:@"取消" style:HLAlertActionStyleCancel handler:^(HLAlertAction *action) { NSLog(@"button one"); }]]; [alert addAction:[HLAlertAction actionWithTitle:@"正常" style:HLAlertActionStyleDefault handler:^(HLAlertAction *action) { NSLog(@"button two"); }]]; [alert addAction:[HLAlertAction actionWithTitle:@"警告" style:HLAlertActionStyleDestructive handler:^(HLAlertAction *action) { NSLog(@"button three"); }]]; [alert addTextFieldWithConfigure:^(UITextField *textField) { textField.placeholder = @"输入账号"; }]; [alert addTextFieldWithConfigure:^(UITextField *textField) { textField.placeholder = @"输入密码"; }]; [alert showWithViewController:self]; [/lang] 图片在1 2 楼 测试环境:Xcode 6.2,iOS 6.0以上

©软件著作权归作者所有。本站所有内容均来源于网络,不得违法使用,仅供学习使用,请支持正版!
转载请注明出处: 662P » 功能齐全的alert视图
发表评论 取消回复