UIAlertView 中的可点击链接 [英] Clickable Link in UIAlertView
问题描述
是否可以在 UIAlertView 的警报消息中添加可点击的链接?特别是在推送通知的情况下?
is it somehow possible to add a clickable link to the alert-message of an UIAlertView? Especially in case of a Push-Notification?
我看到的唯一解决方案是将链接作为字典项添加到推送警报消息中.如果消息与链接一起到达并且应用程序在此打开,我可以检查字典中是否有链接并打开网络视图.
The only solution i see, is to add the link as dictionary-item to the push alert message. If the message arrive with the link and the app is opened hereupon, i can check wheter there is a link in the dictionary and open a webview.
推荐答案
虽然 Apple 强烈反对向 UIAlertView
添加自定义项,但您拥有的唯一方法是扩展 UIAlertView
类本身,将链接添加为子视图,稍后以适当的方式处理.
While adding customizations to a UIAlertView
is strongly discouraged by Apple, the only way you have is to extend the UIAlertView
class itself, adding the link as a subview, handling it later in the appropriate way.
由于这不是正确的方法,您应该考虑改变用户与界面交互的方式.
Since this is not the right approach, you should consider changing the way the user interacts with the interface.
这篇关于UIAlertView 中的可点击链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!