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];

    一个人,一片天,一条路,一瞬间!
  • 相关阅读:
    C#中将全部代码一次性折叠
    C#中图片单击旋转事件
    块参照重命名
    补强圈设计
    c# winform 按名称取得控件
    获得某控件的父控件(容器)中的所有控件
    回车键当Tab键使用
    替换CAD中原有命令为开发人员自己开发的命令的方法
    窗体设置
    判断控件的tag是否为空的方法
  • 原文地址:https://www.cnblogs.com/zcl410/p/4953225.html
Copyright © 2011-2022 走看看