开发者

How to make a clickable link in UITextView

开发者_运维百科I am developing an iphone app right now where i will be displaying an overview text with entries that can be found later in the app. I am wondering if there is a way to make a specific work clickable to send me to another screen that will display more information about the place that was clicked.


You can use this...

self.myTextView.dataDetectorTypes =UIDataDetectorTypeLink;


if you want active substring in your UITextView then you can use my extended TextView... its short and simple. You can edit it as you want.

how to use (range = substring location):

[self.textView addTapActionWithRange:range withActionBlock:^{
      // anything you want to do - show something
}];

result:

How to make a clickable link in UITextView

source code: https://github.com/marekmand/ActiveSubstringTextView

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜