Search code examples
iostitaniumappceleratortitanium-mobiletitanium-modules

Appcelerator Titanium: Links/Images in Labels/TextArea - Open in WebView


Is there a way to make URLs clickable in labels or textarea and open the link in a webview? TextArea has the autoLink property but I don't know a way to handle clicks - safari is opened automatically on click.

Also I don't know how to add images to labels (smileys). I've seen many applications that use smileys in labels and textfields. Is this possible in Ti?

=> Are labels and textareas or other ways to display text completely text-only? (at least on iOS?) Are there any modules that add this functionality? I can't use WebViews every time I want to display a link.


Solution

  • You have a couple choices:

    • Use web views, as you pointed out.
    • Use the Styled Text modules for iOS and Android from Appcelerator. You'll need a subscription to get access to them.
    • Make your own module that displays text with links in it, and customize what happens when the user touches a link.

    The viability of these may change depending on where you want these links to show up, and what their parent will be (a view? a table view? etc).