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)
        }
    

      

  • 相关阅读:
    javascript语法之函数案例练习
    javascript语法之函数的定义
    javascript语法之with语句
    javascript语法之for-in语句
    javascript语法之循环语句小练习
    centos 7 配置samba mount
    Centos 7 systemd.service — Service unit configuration
    Linux 下使用 ffmpeg 大批量合并 ts 文件, mp4切割文件为m3u8
    Debian 系统修改网卡ens33名称为 eth0
    star_namelist
  • 原文地址:https://www.cnblogs.com/mapanguan/p/UIAlertView.html
Copyright © 2011-2022 走看看