- (IBAction)signOutAction:(id)sender {
//初始化,StyleActionSheet是对话框的样式
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"是否注销?" message:@"真的要注销吗" preferredStyle:UIAlertControllerStyleActionSheet];
//添加按钮
[alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];//nil表示不需要任何操作
[alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
//点击确定时要实现的逻辑,这里是返回上级控制器
[self.navigationController popViewControllerAnimated:YES];
}]];
//弹出UIAlertController
[self presentViewController:alert animated:YES completion:NULL];
}

IOS初级:UIAlertController的更多相关文章

  1. IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容

    IOS 修改UIAlertController的按钮标题的字体颜色,字号,内容 UIAlertController *alertVC = [UIAlertController alertControl ...

  2. Unity3D for iOS初级教程:Part 3/3

    转自Unity 3D for iOS 这篇文章还可以在这里找到 英语 Learn how to use Unity to make a simple 3D iOS game! 这份教程是由教程团队成员 ...

  3. Unity3D for iOS初级教程:Part 3/3(上)

    转自:http://www.cnblogs.com/alongu3d/archive/2013/06/01/3111738.html 欢迎来到第三部分,这是Unity 3D for iOS初级系列教程 ...

  4. iOS 最新UIAlertController

    iOS 8的新特性之一就是让接口更有适应性.更灵活,因此许多视图控制器的实现方式发生了巨大的变化.全新的UIPresentationController 在实现视图控制器间的过渡动画效果和自适应设备尺 ...

  5. iOS学习——UIAlertController详解

    在开发中,弹出提示框是必不可少的.这两天项目中统一对已经被iOS API废弃的UIAlertView和UIActionSheet进行替换,我们知道,UIAlertView和UIActionSheet都 ...

  6. iOS通过UIAlertController弹出底部选择框来调用相机或者相册

    UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:nil message:nil preferredSt ...

  7. iOS开发——UIAlertController

    iOS8之后,UIAlertView和UIActionSheet被干掉了,取而代之的是UIAlertController和UIAlertAction. UIAlertController有两种样式,一 ...

  8. iOS 8 UIAlertController 和 UIAlertAction

    将alertView 和 actionSheet 封装在UIAlertController 里面化整为零,使开发者更便利 当我们一味的追求高内聚,低耦合的时候,伟大的苹果反其道而行之,这也告诉了我们一 ...

  9. [iOS]改变UIAlertController的标题、内容的字体和颜色

    https://www.jianshu.com/p/51949eec2e9c 2016.03.23 22:36* 字数 272 阅读 37401评论 54喜欢 72 在开发中,弹出框是必不可少的,通常 ...

随机推荐

  1. .net 中使用oracle 的sql 语句

    string sqlString = "Select * From emp  Where EMPNO=7369“; 一定不要写成 string sqlString = "Selec ...

  2. NIO简单理解

    NIO:新IO,同步的非阻塞IO. 1.Java NIO 由以下几个核心部分组成:Channels(通道).Buffers(缓冲区).Selectors(选择器) Channels(通道) 1.所有的 ...

  3. .mht文件转换为html

    用360浏览器打开文件后,Ctrl + s  保存即可

  4. 比较perl+python

    作者:iTech出处:http://itech.cnblogs.com/ http://hyperpolyglot.org/scripting   perl (1987) python (1991) ...

  5. Codeforces Beta Round #35 (Div. 2)

    Codeforces Beta Round #35 (Div. 2) http://codeforces.com/contest/35 A 这场的输入输出是到文件中的,不是标准的输入输出...没注意看 ...

  6. 从零开始写bootloader(1)

          下面是具体的代码实现:  #define S3C2440_MPLL_200MHZ ((0x5C<<12)|(0x01<<4)|(0x02)) #define MEM ...

  7. centos下安装&&配置redis

    一.Redis介绍 Redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcache类似,但很大程度补偿了Memcache的不足,它支持存储的value类型相对更多 ...

  8. http406错误

    The resource identified by this request is only capable of generating responses with characteristics ...

  9. ubuntu下安装mysql及常用操作

    1.可通过ps -ef | grep mysql命令查看系统中是否有安装mysql 如果出现类似上述的页面,就证明是已经安装过了mysql,否则就是没有. 2.安装mysql 很简单,只需要键入如下命 ...

  10. Server2003+IIS6+TP-Link+花生壳配置

    Server2003+IIS6+TP-Link+花生壳配置外网一共分四步: 固定Server2003电脑的局域网IP地址. 设置IIS网站中的TCP端口. 在TP-Link中设置转发规则. 申请花生壳 ...