iOS 开发中关于弹窗的几种方式
来源:互联网 发布:js获取div的id值 编辑:程序博客网 时间:2024/05/17 23:10
1.IOS8以前的方式:
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"输入的数字不合理" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil]; [alertView show];
2.IOS8以后最新方式:(ios 9 推荐使用,ios7的在ios9中已过期)
*ios8创建弹框的方法:
UIAlertController *alertVc =[UIAlertController alertControllerWithTitle:@"提示" message:@"输入数字不合理" preferredStyle:UIAlertControllerStyleAlert];*ios8显示弹框的方法:
[self presentViewController:alertVc animated:NO completion:nil];
*ios8添加按钮的方法:
[alertVc addAction:[UIAlertActionactionWithTitle:@"取消" style: UIAlertActionStyleCancel handler:^(UIAlertAction*action) { NSLog(@"点击了取消按钮");
3.actionsheet弹窗:(底部弹窗)
UIActionSheet *sheet = [[UIActionSheetalloc]initWithTitle:@"确定要注销?" delegate:selfcancelButtonTitle:@"取消" destructiveButtonTitle:@"确定" otherButtonTitles:nil,nil];
[sheet showInView:self.view];
- (void)actionSheet:(UIActionSheet *)actionSheetclickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex ==0) {
[self.navigationControllerpopViewControllerAnimated:YES];
}
}
1 0
- iOS 开发中关于弹窗的几种方式
- iOS中关于json解析的几种方式
- IOS开发中页面跳转的几种方式
- iOS开发中拉伸图片的几种方式
- iOS开发中方法延迟执行的几种方式
- iOS开发中方法延迟执行的几种方式
- iOS开发中方法延迟执行的几种方式
- iOS开发中方法延迟执行的几种方式
- iOS 开发中方法延迟执行的几种方式
- iOS开发的几种加密方式
- iOS开发中本地几种存储方式
- iOS开发中方法延迟执行的几种方式-简书
- 浅谈iOS开发中方法延迟执行的几种方式
- 浅谈iOS开发中方法延迟执行的几种方式(转载)
- 浅谈iOS开发中方法延迟执行的几种方式
- 总结iOS App开发中控制屏幕旋转的几种方式
- 浅谈iOS开发中方法延迟执行的几种方式
- 总结iOS App开发中控制屏幕旋转的几种方式
- 一些网络设备的学习笔记
- HDFs数据读取过程
- scrapy xpath取包含某些特定文字的选择器,获取一个标签下的所有text(包括自身和子孙)
- 关于PHp的思考
- bios
- iOS 开发中关于弹窗的几种方式
- 给IT新人的15点建议:苦逼程序员的辛酸反省与总结
- DWR搭建以及使用教程
- phpwind 会员添加字段操作过程
- Android开发学习笔记:5大布局方式详解
- 在OpenGL中进行多纹理贴图
- 网络编程1--UDP
- ZOJ.1730 Crazy Tea Party 2015/09/22
- [KMP][HDU3336][Count the string]