Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>One option is by using <code>UIDataDetectorTypeLink</code>. Check this <a href="http://mobiledevelopertips.com/user-interface/creating-clickable-hyperlinks-from-a-url-phone-number-or-address.html" rel="nofollow noreferrer">link for more details.</a></p> <pre><code>// Create textview, centering horizontally UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0, 10, 320, 50)]; // Set font, background and alignment [textView setFont:[UIFont boldSystemFontOfSize:16]]; [textView setBackgroundColor:[UIColor blackColor]]; [textView setTextAlignment:UITextAlignmentCenter]; // Unfortunately the link will show as blue even with this setting // [textView setTextColor:[UIColor greenColor]]; // Edit and scrolling off [textView setEditable:NO]; [textView setScrollEnabled:NO]; // Set data type to specify URL/link [textView setDataDetectorTypes:UIDataDetectorTypeLink]; // Set text as URL [textView setText:@"text.com"]; [self.view addSubview:textView]; </code></pre> <p>Some other options are <code>UIWebview</code> with delegates to handle touch on urls in it. And another option is <a href="http://furbo.org/2008/10/07/fancy-uilabels/" rel="nofollow noreferrer">fancy UILabels</a></p> <p>For the other questions you asked, check this <a href="https://stackoverflow.com/questions/1555294/how-to-open-a-uitextview-url-in-ui-web-view">How to open a UITextView URL in UI Web View?</a>, <a href="https://stackoverflow.com/questions/2358343/is-there-a-way-to-create-custom-uidatadetectortypes">Is there a way to create custom UIDataDetectorTypes?</a> and <a href="https://stackoverflow.com/questions/7256491/change-color-of-uitextview-links-with-a-filter">Change color of UITextView links with a filter?</a> </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload