🌤️ 加载中...
#
IOS 2019-03-22

IOS开发笔记-自定义提示弹窗

By Jove 1 Views 2 MIN READ 0 Comments

1.新建一个消息弹窗方法,弹窗标题"错误!",关闭弹窗按钮是“好的”

    func showMsgbox(_message: String, _title: String = "错误!") {
        let alert = UIAlertController(title: _title, message: _message, preferredStyle: UIAlertController.Style.alert)
        let btnOK = UIAlertAction(title: "好的", style: .default, handler: nil)
        alert.addAction(btnOK)
        self.present(alert, animated: true, completion: nil)
    }

2.调用自定义弹窗函数

showMsgbox(_message: "弹窗里要显示的内容")

本文由 Jove 原创

采用 CC BY-NC-SA 4.0 协议进行许可

转载请注明出处:https://www.jozxing.cc/index.php/archives/1547/

TAGS: 无标签

相关推荐

  • 暂无相关推荐,看看别的吧。

0 评论