url in label (IOS)
How can i make a link in a labeltext on iOS platform?
thanks!
3 Answers
-
You could use a textarea for this.
If you don't want the user to edit it you can put it as ' editable: false '.
To detect the links you can use the property ' autoLink '.
Here's an example:
var textarea = Titanium.UI.createTextArea({ top: 10, left: 10, right: 10, bottom: 10, borderRadius: 10, editable: false, //This property can be removed if you want the user to edit the text width: '90%', color: '#888', height: '140', value: "Value of the field, if it contains an URL like www.google.com it will be highlighted and clickable", font: { fontSize: 13, fontFamily: 'Helvetica-Bold' }, autoLink: Ti.UI.AUTODETECT_ALL });Hope this solves your problem
Tjeu
-
The best way to do this is with a click event listener and calling this in the event listener to the url you desire
-
I'm pretty use you'd need to use a webView to do that on iOS, then use some JS in the head script of the webView contents to fire a custom event back in to your main JS script depending on what you want to happen when a link is clicked.