zoukankan      html  css  js  c++  java
  • iOS7和iOS8之后的弹窗的使用

    在iOS7之前的弹窗都是使用的传统的UIAlertView,代码如下:

    //创建弹框
    
      UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"输入的数字不合理" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:nil, nil];
    
    //显示弹框
     [alertView  show];
    

    在iOS8以来的弹框方式变为:

    //                2.3.1创建一个弹框
            UIAlertController *alertVc = [UIAlertController alertControllerWithTitle:@"提示" message:@"输入的数字不合理" preferredStyle:UIAlertControllerStyleAlert];
            //        2.3.2添加取消按钮
            [alertVc addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
            //        2.3.3.显示
            [self presentViewController:alertVc animated:NO completion:nil];
    

      

  • 相关阅读:
    jQuery-选择器及属性修改
    jQuery 基础理论
    CSS 之 BFC(块级格式化上下文)
    H5--Web Storage
    H5 -WebWorker
    H5 --拖放
    nodejs Multer中间件
    k8s pod
    kubernetes
    优化CUDA数据传输
  • 原文地址:https://www.cnblogs.com/gaizuojia/p/4631714.html
Copyright © 2011-2022 走看看