美文网首页
swift UIAlertController中Message文

swift UIAlertController中Message文

作者: 微微小笋 | 来源:发表于2017-07-19 13:59 被阅读0次

let alert = UIAlertController(title: "温馨提示", message: "1.哈哈哈哈哈哈哈哈哈哈或或。\n2.哈哈哈哈哈啊哈哈啊。", preferredStyle: .alert)

let subView1 : UIView = alert.view.subviews[0]

let subView2 : UIView = subView1.subviews[0]

let subView3 : UIView = subView2.subviews[0]

let subView4 : UIView = subView3.subviews[0]

let subView5 : UIView = subView4.subviews[0]

//    let title = subView5.subviews[0] as! UILabel

let message = subView5.subviews[1] as! UILabel

message.textAlignment = .left

alert.addAction(UIAlertAction(title: "确定", style: UIAlertActionStyle.default) { (_) in

})

present(VC, animated: true, completion: nil)

参考文章:http://www.jianshu.com/p/b84e1bc81666

相关文章

网友评论

      本文标题:swift UIAlertController中Message文

      本文链接:https://www.haomeiwen.com/subject/trslkxtx.html