zoukankan      html  css  js  c++  java
  • iOS弹出提示框

    在iOS8之后,弃用了UIAlertView(我倒是很喜欢用这个,用着正顺手呢,不理解为什么要删掉),不过现在的UIAlertController也有她的有点。

    现在的提示框是UIAlertController和UIAlertAction相结合

    具体实现,如下:

     UIAlertController *alertController=[UIAlertController alertControllerWithTitle:@"温馨提示" message:@"    身份一经确定,不可更改!如果您正准备考研,请『取消』后选择『我是学员』" preferredStyle:UIAlertControllerStyleAlert];

        

        //确认

        UIAlertAction *confirmAction=[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {

           // 点击确认按钮时触发的事件

            // PerfectInformationViewController *perfectinformationVC=[[PerfectInformationViewController alloc] initWithNibName:@"PerfectInformationViewController" bundle:nil];

           // [self.navigationController pushViewController:perfectinformationVC animated:YES];

            

        }];

        

        //取消

        UIAlertAction *cancelAction=[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {  

     // 点击取消按钮时触发的事件           

        }];

     

        [alertController addAction:confirmAction];

        [alertController addAction:cancelAction]; 

        [self presentViewController:alertController animated:YES completion:nil];

    一个人,一片天,一条路,一瞬间!
  • 相关阅读:
    服务器被黑

    ZXW说
    抽象类
    URL参数加密解密过程
    SqlServer 跨服务器 DML
    发布
    C#操作XML小结
    定时指执程序
    SQL语句判断数据库、表、字段是否存在
  • 原文地址:https://www.cnblogs.com/zcl410/p/4953225.html
Copyright © 2011-2022 走看看