iOS开发-UIActionSheet和UIAlertController
来源:互联网 发布:弹簧刀 知乎 编辑:程序博客网 时间:2024/06/05 08:57
ActionSheet
- (void)buttonPressed:(id)sender{ /** UIActionSheet已经在8.3后被弃用了,如果想要去掉警告信息,可以把项目的Deployment Target设置为8.3以下,就可以去掉警告了。 */ /** Title:如果不想要title,可以设置为nil; 注意需要实现UIActionSheetDelegate; destructiveButtonTitle:设置的按钮文字是红色的; otherButtonTitles:按照按钮顺序; */ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"这是标题" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"确定" otherButtonTitles:nil]; /** * UIActionSheetStyleAutomatic UIActionSheetStyleDefault UIActionSheetStyleBlackTranslucent UIActionSheetStyleBlackOpaque */ //这里的actionSheetStyle也可以不设置; actionSheet.actionSheetStyle = UIActionSheetStyleAutomatic; [actionSheet showInView:self.view]; }
AlertController
- (void)buttonPressed1:(id)sender{ NSLog(@"dianji"); // 初始化提示框 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"Message" preferredStyle:UIAlertControllerStyleActionSheet]; [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSLog(@"点击确定"); }]]; [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { NSLog(@"点击取消"); }]]; [self presentViewController:alert animated:true completion:nil];}
4 0
- iOS开发-UIActionSheet和UIAlertController
- IOS-UIAlertController(UIAlertView和UIActionSheet二合一)
- iOS 10 UIActionSheet UIAlertController
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- IOS开发之 ---- iOS8中提示框的使用UIAlertController(UIAlertView和UIActionSheet二合一)
- 【学习ios之路:UI系列】UIAlertView. UIActionSheet 和 UIAlertController
- IOS基础UI之(五)UIAlertView、UIActionSheet和UIAlertController详解
- iOS 8 引入的 UIActionSheet 和 UIAlertView 的替代品 - UIAlertController
- UIAlertController,取代UIAlertView和UIActionSheet
- iOS UIAlertController代替代替UIAlertView与UIActionSheet
- iOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- IOS UIAlertController 弹框 (iOS 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- IOS UIAlertController 弹框 (ios 9.0 后代替了UIAlertView弹框 和 UIActionSheet下弹框)
- 【UI进阶】UIAlertController替代UIAlertView和UIActionSheet
- Android抽象布局——include、merge 、ViewStub
- Android性能优化-泛谈 (一)
- Zip4j简单使用
- BNUOJ 51279[组队活动 Large](cdq分治+FFT)
- 我的recycleview 总结
- iOS开发-UIActionSheet和UIAlertController
- Unity3D-Input类Axes自定义
- android 获取手机中的短信信息
- Android 系统稳定性 - OOM(一)
- LeetCode:3 Longest Substring Without Repeating Characters
- recycleview详解
- 转载】在 Mac OS X El Capitan 文件权限问题解决方法 (以安装 IPython 为例)
- Android 系统稳定性 - OOM(二)
- 导航栏制作