zoukankan      html  css  js  c++  java
  • UIAlertController

    UIAlertView iOS9.0之后注销了,简单介绍一下UIAlertController的使用:

     //提醒控制器类型有两种UIAlertControllerStyleActionSheet和UIAlertControllerStyleAlert
      UIAlertController *alertC=[UIAlertController alertControllerWithTitle:@"" message:@"" preferredStyle:UIAlertControllerStyleActionSheet];  
     //
      UIAlertController *alert=[UIAlertController alertControllerWithTitle:@"title" message:@"message" preferredStyle:UIAlertControllerStyleAlert];
       
     //
      UIAlertAction *cancel=[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action){
            
        }];
    
     //添加动作
        [alert addAction:cancel];
     //添加textfield
        [alert addTextFieldWithConfigurationHandler:^(UITextField *text){
            
        }];
     //展示提醒控制器
        [self presentViewController:alert animated:YES completion:nil];
  • 相关阅读:
    函数对象与闭包
    20.03.19作业
    关键字参数,名称空间和作用域
    作业03.18
    函数第二天
    20.03.17作业
    文件
    20.01.16作业
    前端基础
    前端知识(二)
  • 原文地址:https://www.cnblogs.com/sunjianfei/p/5570853.html
Copyright © 2011-2022 走看看