Problem Description
You can't mix the use of ATTRIBUTE_LINK and ATTRIBUTE_FOREGROUND_COLOR. Each one works fine by itself.
Steps to reproduce
1. Create a new mobile project classic titanium
2. Add this code to app.js:
var win = Titanium.UI.createWindow({
backgroundColor: '#ddd',
});
win.open();
var text = 'My Site Is !Google!';
var attr = Titanium.UI.iOS.createAttributedString({
text: text
});
attr.addAttribute({
type: Titanium.UI.iOS.ATTRIBUTE_LINK,
value: 'https://www.google.com.bd',
range: [text.indexOf('!Google!'), ('!Google!').length]
});
attr.addAttribute({
type: Titanium.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,
value: "green",
range: [text.indexOf('!Google!'), ('!Google!').length]
});
var label = Titanium.UI.createLabel({
left: 20,
right: 20,
height: Titanium.UI.SIZE,
attributedString: attr
});
win.add(label);
3. Run in a device
Actual results
As you can see, if you mix ATTRIBUTE_FOREGROUND_COLOR and ATTRIBUTE_LINK, the only working will be ATTRIBUTE_LINK.
Expected results
being able to mix ATTRIBUTE_LINK and ATTRIBUTE_FOREGROUND_COLOR. Currently, if you do a mix of ATTRIBUTE_BACKGROUND_COLOR and ATTRIBUTE_LINK, it will work just fine.
No comments