zoukankan      html  css  js  c++  java
  • Swift3 使用系统UIAlertView方法做吐司效果

        

       /**
         *显示弹出信息
         */
        class func showAlertMessage(_ str:String,showtime Num:Double){
            
            let alert = UIAlertView(title: str, message: nil, delegate: nil, cancelButtonTitle: nil);
            alert.show()
            //        self.performSelector(#selector(dismissAlert(_:)), withObject: alert, afterDelay: Num)
            let dispatchTime: DispatchTime = DispatchTime.now() + Double(Int64(0.10 * Num * Double(NSEC_PER_SEC))) / Double(NSEC_PER_SEC)
            DispatchQueue.main.asyncAfter(deadline: dispatchTime, execute: {
                dismissAlert(alert)
            })
        }
        
        class func dismissAlert(_ alert:UIAlertView){
            alert.dismiss(withClickedButtonIndex: alert.cancelButtonIndex, animated: true)
        }
    

      

  • 相关阅读:
    Maven入门教程
    认识Java Core和Heap Dump
    [Java IO]03_字符流
    Eclipse 实用技巧
    可变和不可变的区分
    什么猴子补丁待补充
    当退出python时,是否释放全部内存
    解释python中的help()和dir()函数
    在python中是如何管理内存的
    解释一下python中的继承
  • 原文地址:https://www.cnblogs.com/mapanguan/p/UIAlertView.html
Copyright © 2011-2022 走看看