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

     

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
  • 相关阅读:
    刻意练习:从一般到卓越的方法
    Spring JMS 整合 ActiveMQ
    冒泡排序 快速排序
    TCP协议,UDP 协议的区别
    HashMap实现原理
    java 类加载过程
    Linux-vim命令(3)
    Linux-vim命令(2)
    Linux-vim命令(1)
    Linux-命令里的快捷键
  • 原文地址:https://www.cnblogs.com/developer-ios/p/4917759.html
Copyright © 2011-2022 走看看