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

    一个人,一片天,一条路,一瞬间!
  • 相关阅读:
    JS第一次课
    第四课:盒子模型+浮动+定位
    第三课:CSS
    第二课:HTML和CSS
    第一节课!HTML
    大家好
    MVC5 Views文件夹访问不了css,js
    数据挖掘之关联分析七(非频繁模式)
    数据挖掘之关联分析六(子图模式)
    数据挖掘之关联分析五(序列模式)
  • 原文地址:https://www.cnblogs.com/zcl410/p/4953225.html
Copyright © 2011-2022 走看看