我有这样的代码:
func alertBox(txt: String){
let ac = UIAlertController(title: "MyTtle" , message: "More information in my website: ", preferredStyle: .alert)
let ramkaNaObrazek = CGRect(origin: CGPoint(x: 10, y: 10), size: CGSize(width: 30, height: 30))
let ikonaAlertu = UIImageView(frame: ramkaNaObrazek)
ikonaAlertu.image = UIImage(named: "modal_podpowiedz")
ac.view.addSubview(ikonaAlertu)
ac.addAction(UIAlertAction(title: "Ok" , style: .cancel, handler: { (action: UIAlertAction!) in
}))
present(ac, animated: true)
}
我想在这段文字之后加上:“我的网站上有更多的信息:”+ www --我的网站(http://www.myname.pl)的链接。
我该怎么做?
发布于 2018-04-10 13:28:22
您不能添加自定义字段(如文本视图)和可单击链接到UIAlertController
。您需要创建自己的模态视图控制器,该控制器与UIAlertController
类似,也需要使用第三方框架为您服务。
https://stackoverflow.com/questions/49754343
复制相似问题