• UIActionSheet的常用方法


    enum UIActionSheetStyle : Int {
        
        case Automatic // take appearance from toolbar style otherwise uses 'default'
        case Default //默认风格:灰色背景上显示白色文字  
        case BlackTranslucent ////透明黑色背景,白色文字
        case BlackOpaque // //纯黑背景,白色文字  
    }
    //初始化,标题,代理,取消按钮,销毁按钮
    init(title: String?, delegate: UIActionSheetDelegate?, cancelButtonTitle: String?, destructiveButtonTitle: String?) unowned(unsafe) var delegate: UIActionSheetDelegate?

      var title: String

    //风格

        var actionSheetStyle: UIActionSheetStyle 

    //添加按钮

    func addButtonWithTitle(title: String) -> Int

    // 返回 buttonIndex位置的按钮标题

    func buttonTitleAtIndex(buttonIndex: Int) -> String

    //获取有多个按钮

    var numberOfButtons: Int { get }

    //取消按钮的下标

     var cancelButtonIndex: Int 

    //销毁按钮的下标

      var destructiveButtonIndex: Int 

    //第一个其他按钮的下标

     var firstOtherButtonIndex: Int { get } 

      var visible: Bool { get }

     

     

    //showInview可能会导致弹出菜单被toolbar挡住,最下面的按钮不一定能接受的touch事件,showFromToolbar 是在toolbar上方弹出,就不会有这个问题 
    //在toolbar上面显示
    func showFromToolbar(view: UIToolbar!) func showFromTabBar(view: UITabBar!) @availability(iOS, introduced=3.2) func showFromBarButtonItem(item: UIBarButtonItem!, animated: Bool) @availability(iOS, introduced=3.2) func showFromRect(rect: CGRect, inView view: UIView!, animated: Bool) func showInView(view: UIView!)
  • 相关阅读:
    OKHttp的使用
    多点触控
    事件分发机制的理解
    Activity的四种启动模式
    反射动态建表
    px,dp,sp三者的转换
    动态广播和静态广播的区别
    字符串转日期格式
    hive Metastore contains multiple versions
    记一次 qW3xT.4,解决挖矿病毒。
  • 原文地址:https://www.cnblogs.com/qzp2014/p/4273968.html
Copyright © 2020-2023  润新知