Search code examples
androidtitanium-mobilehtml-encode

auto link a web view Titanium


recently I've been working on a project that gets a response from a a website as an HTML document. I'm trying to do 2 things:

  1. parse the HTML to show the way its supposed to (doable within a webView).

    2.auto link all the parsed text.

Is there a way to do both those things in the same area? all I managed to do up to now is one of the 2 and I'm kinda puzzled thanks a bunch and have a great day!


Solution

  • Well, I found the answer. there are 2 different attributes for a label in Titanium. the first one is for regular text, and it is the attribute "text". the second one is an HTML parser that get as input HTML code and renders it into a viewable text format. it's called "html" the final code was:

    var label = Ti.UI.createLabel({ html:sourceHTML, ... });