Closed arrk-jeevank closed 8 years ago
I am using Titanium sdk 3.5.1, so i had used older version of your module.
Using an older version fixed it?
with titanium sdk 3.5.1 + ti.html2as 1.2.1 <a href="">
tag is not working. the below how i have used in IOS
<Label module="xp.ui" html="<font size=17>Hello <a href='http://www.google.com/'>www.google.com</a> world <a href='http://google/'>welcome</a>.</font>" />
In what way is it not working?
<Label module="xp.ui" html="<font size=17>Hello <a href='http://www.google.com/'>www.google.com</a> world <a href='http://google/'>welcome</a>.</font>" />
@arrk-jeevank you have to use markdown formatting to insert XML ;)
I mean, what result does that code get you? Do you have a screenshot?
<Label module="xp.ui" html="<font size=17>Hello <a href='http://www.google.com/'>www.google.com</a> world <a href='http://google/'>welcome</a>.</font>" />
the links are not opening in the browser , it didn't thrown any error , it looks like hyperlink but not opening
You did add a listener to the link
event?
no , i will try and let you know
That's a requirement ;0 See http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Label-event-link
using attributed string i had tried with link event. it didn't work , so i tried to use your module it gives me the same. both didn't work . link event not getting fired
This module also uses Attributed String, it just converts HTML to an Attributed String for you. Could you post a full code sample?
var text=“hello goole (www.google.com) world”
var attr = Ti.UI.iOS.createAttributedString({
text: text,
attributes: [
{
type: Titanium.UI.iOS.ATTRIBUTE_LINK,
value: "https://github.com/appcelerator/hyperloop",
range: [text.indexOf('www.google.com), ('www.google.com').length]
} ,
{
type: Titanium.UI.iOS.ATTRIBUTE_LINK,
value: "https://google.com",
range: [text.indexOf(‘world’), (‘world’).length]
}
]
});
attr.addEventListener('link', function(e){
Ti.API.info(JSON.stringify(e));
});
You need to add the event listener to the label you add the attributed string to. Please check the api reference I linked above.
$.type.addEventListener('link', function(e){
Ti.API.info(JSON.stringify(e));
});
$.type.attributedString=attr;
Label tag below
Label id="type" class="disclamier-text"> Providing this information will help us show you the most appropriate parts of this > app</Label
Closing as I can't reproduce and seems like a Ti bug, if any.
Hi Fokke,
i am using your ti-html2as(1.2.1) module, it working fine in andriod, but when i have implemented the same for ios then the text is displaying as Hyperlinks but those where not clickable or i can say not opening in safari or chrome browsers. Using simulators and with devices like (iphone 4s and Ipad 2) i have tested it not working.
Thanks & Regards Jeevan K Reddy