zoukankan      html  css  js  c++  java
  • ios里的UIActionSheet的使用

    class ViewController: UIViewController,UIActionSheetDelegate{
        @IBOutlet weak var label1: UILabel!
    
        @IBAction func button1(sender: UIButton) {
            let actionSheet1 = UIActionSheet(title: nil, delegate: self, cancelButtonTitle: "取消分享", destructiveButtonTitle: "分享到新浪微博", otherButtonTitles: "分享到QQ空间")
            
            actionSheet1.showInView(self.view)
            
        }
        func actionSheet(actionSheet: UIActionSheet, clickedButtonAtIndex buttonIndex: Int) {
            label1.text = actionSheet.buttonTitleAtIndex(buttonIndex)
        }
        
        @IBAction func button2(sender: UIButton) {
            
            let alertController = UIAlertController(title: "标题", message: "这个是UIAlertController的默认样式", preferredStyle: UIAlertControllerStyle.Alert)
            let cancelAction = UIAlertAction(title: "取消", style: .Cancel, handler: nil)
            let okAction = UIAlertAction(title: "好的", style: .Default, handler: nil)
            alertController.addAction(cancelAction)
            alertController.addAction(okAction)
            self.presentViewController(alertController, animated: true, completion: nil)
            }
        
        
        override func viewDidLoad() {
            super.viewDidLoad()
            // Do any additional setup after loading the view, typically from a nib.
        }
    
        override func didReceiveMemoryWarning() {
            super.didReceiveMemoryWarning()
            // Dispose of any resources that can be recreated.
        }
    }
  • 相关阅读:
    Hadoop IO
    HDFS
    简介
    队列
    classLoader和Class.forName的区别
    String为什么是final类型的
    Fabric
    超级账本——面向企业的分布式账本
    以太坊
    pycharm破解教程
  • 原文地址:https://www.cnblogs.com/adjk/p/5112280.html
Copyright © 2011-2022 走看看