有没有一种方法可以为寻找附加信息的用户添加 url?我的警报看起来像这样
let alert = UIAlertController(title: "Alert details", message: "For more detailed information, click the link below", preferredStyle: UIAlertControllerStyle.Alert)
// add url here
let okayAction = UIAlertAction(title: "Ok", style: .Default) { (action) in
print(action)
}
alert.addAction(okayAction)
这个想法是将它们重定向到网页并关闭应用程序中的 UIAlertController
您不能向 UIAlertController 添加任意接口。标题和消息不可点击。您无法添加更多文本。相反,添加另一个按钮 (UIAlertAction) 将它们定向到网页。或者使用其他接口而不是 UIAlertController (例如,您可以放置一个呈现的视图控制器looks就像警报一样)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)