iOS-UIAlertController的另类使用
来源:互联网 发布:js滚动选择控件 编辑:程序博客网 时间:2024/06/05 17:03
先看图,意外发现很神奇的东西,最后发现……其实就是UIAlertController
这个风格用的比较少
具体实现代码:
- (IBAction)alertAction { UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"致开发者的一封信" message:@"有了您的支持才能更好的为您服务,提供更加优质的,更加适合您的App,当然您也可以直接反馈问题给到我们" preferredStyle:(UIAlertControllerStyleAlert)]; UIAlertAction *refuseAction = [UIAlertAction actionWithTitle:@"��残忍拒绝" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) { NSLog(@"��残忍拒绝"); }]; UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"��好评赞赏" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) { NSLog(@"��好评赞赏"); }]; UIAlertAction *showAction = [UIAlertAction actionWithTitle:@"��我要吐槽" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction *action) { NSLog(@"��我要吐槽"); }]; [alertController addAction:refuseAction]; [alertController addAction:okAction]; [alertController addAction:showAction]; [self presentViewController:alertController animated:YES completion:nil];}
总结:因为在开发中,UIAlertController用的还是比较频繁的,还有一个就是MBProgressHUD提示框
我在项目中都是提前把他们封装起来,直接通过类方法调用,省去了很多的时间和代码量,有时间和大家分享一下。
建议大家多多封装一些工具类,有助于对代码的优化以及对封装的理解,同时也节省了不少的时间
0 0
- iOS-UIAlertController的另类使用
- iOS开发 UIAlertController的创建与使用
- iOS开发:使用UIAlertController的各种姿势
- iOS开发之UIAlertController的使用
- iOS UIAlertController 使用介绍
- ios UIAlertController使用
- iOS 8中使用UIAlertController
- iOS 8中使用UIAlertController
- iOS 8 中UIAlertController使用
- iOS UIAlertController使用方法如何使用
- iOS开发进阶-UIAlertController使用
- UIAlertController的使用(Swift)
- UIAlertController的使用示例
- UIAlertController的使用二
- UIAlertController的使用
- UIAlertController的使用
- 关于UIAlertController的使用
- UIAlertController的使用
- Android 禁止输入emoji表情符号
- Qt 下 Singleton单例模式小记
- 描述一个避免初始化散列表的过程(以消耗内存为代价)
- 模板 大数的斐波那契额数列(可以用来求大数加法)
- input type=hidden name='x'的用法总结
- iOS-UIAlertController的另类使用
- unity 调用安卓系统摄像机和相册并对图片进行裁剪(一)
- Linux cat命令详解
- LeetCode---Isomorphic Strings、Word Pattern解题分析
- java 转义符小结
- 57-004-1 bootstrap定义一个导航页面包括bootstrap面板,表格,分页,胶囊导航等样式
- HDU-1251 统计难题(前缀树)
- OC开发 --- 连式语法API设计 (使用block)
- Java NIO系列教程(二) Channel