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.
        }
    }
  • 相关阅读:
    uwsgi
    protobuf c++ API
    memcached 第二篇----安装使用
    ice grid配置使用第二篇------实际使用
    ICE BOX 配置,使用----第一篇
    可视化资料收集
    Protocol Buffers
    ice grid 完整部署过程
    django组件之ajax
    关于Django在写小项目的一些小注意事项
  • 原文地址:https://www.cnblogs.com/adjk/p/5112280.html
Copyright © 2011-2022 走看看