zoukankan      html  css  js  c++  java
  • UIAlertController

     
      

    专题 UIAlertController

      

    // iOS8之前
    
        // UIAlertView
    
        // UIActionSheet;
    
        
    
        // iOS8开始
    
        // UIAlertController == UIAlertView + UIActionSheet
    
        UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
    
        
    
        // 添加按钮
    
        [alert addAction:[UIAlertAction actionWithTitle:@"收藏" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    
            XMGLog(@"点击了[收藏]");
    
        }]];
    
        [alert addAction:[UIAlertAction actionWithTitle:@"举报" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
    
            XMGLog(@"点击了[举报]");
    
        }]];
    
        [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
    
            XMGLog(@"点击了[取消]");
    
        }]];
    
        
    
        [self.window.rootViewController presentViewController:alert animated:YES completion:nil];

     

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
  • 相关阅读:
    关于js中this的指向问题
    关于css垂直水平居中的几种方法
    个人第一个jquery插件(tips)
    css3实现虚拟三角形
    js-关于唯一ID的创建
    面试题
    new Promise()
    JSON.parse()、JSON.stringify()和eval()的作用
    vue-router路由导航
    NodeJS
  • 原文地址:https://www.cnblogs.com/developer-ios/p/4917759.html
Copyright © 2011-2022 走看看