如何在UIAlertView的消息中添加可触摸的Url链接到URL? [英] How to add a touchable Url link to a url in a UIAlertView's message?

查看:175
本文介绍了如何在UIAlertView的消息中添加可触摸的Url链接到URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个网址的可点击链接添加到 UIAlertView 的消息中。
这样当用户看到警报视图时,他们可以触摸消息内的链接。或者,他们可以通过单击确定按钮进入下一步。

I want to add a clickable link of an url into UIAlertView's message. Such that when user sees the alert view, they can can touch on link inside message. Alternatively they can go next by clicking on the OK button.

可以这样做吗?怎么样?

Is possible to do it? How?

推荐答案

我看到实现你想要的唯一方法是通过自定义警报视图。

The only way I see to implement what you are trying to is through a custom alert view.

您可以采取几种方法。一个是UIAlertView的子类,在这里您可以找到一个简短的教程: UIAlertView子类。在您的子类中,您可以以任何方式构建警报,以实现启用触摸的文本。请查看本教程一种方法。

There are several approaches that you can take. One is subclassing UIAlertView and here you can find a short tutorial: Subclass UIAlertView. In your subclass you could then build the alert any way you like to implement the touch-enabled text. Have a look at this tutorial for a way to do it.

这篇关于如何在UIAlertView的消息中添加可触摸的Url链接到URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆