UIAlertController *actionSheet = [UIAlertController alertControllerWithTitle:@"确定要退出登录吗?" message:nil preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *alertT = [UIAlertAction actionWithTitle:@"退出登录" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击退出登录");
}];
UIAlertAction *alertF = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
NSLog(@"点击了取消");
}];
[actionSheet addAction:alertT];
[actionSheet addAction:alertF];
[self presentViewController:actionSheet animated:YES completion:nil];
iOS UIAlertController
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 参考文档:https://developer.apple.com/reference/uikit/uialertc...
- 1.中间弹出效果: UIAlertController *alert = [UIAlertController a...
- 答:废话不多说直接上代码。如下所示: /* 类方法快速创建一个提示控制器 值得注意的是这个控制器有个preferr...
- UIAlertControlle有两种preferredStyle 1.UIAlertControllerStyl...
- 这个是最新的提示框的使用 ,用以前的方法 总是报⚠️ 所以 就用这个了 //创建sheet提示框,提示选择相机还是...