Swift基础入坑

提示框

2018-06-11  本文已影响14人  iOS_July

target:点击按钮---->屏幕中间弹出提示框

let alertAC = UIAlertController(title: "提示", message: "您点击切换了背景色", preferredStyle: .alert)

let trueBtn = UIAlertAction(title: "好的", style: .default, handler: nil)

alertAC.addAction(trueBtn)
        
self.present(alertAC, animated: true, completion: nil)   

target:点击按钮---->屏幕底部弹出提示框

let alertAC = UIAlertController(title: "提示", message: "您点击切换了背景色", preferredStyle: .alert)

let trueBtn = UIAlertAction(title: "好的", style: .actionSheet, handler: nil)

alertAC.addAction(trueBtn)
        
self.present(alertAC, animated: true, completion: nil)   
上一篇 下一篇

猜你喜欢

热点阅读