[AC-1052] iOS: color-property sometimes overrides color set in attributedString
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-06T06:06:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | TCSupportTriage, attributedString, color |
Reporter | Fokke Zandbergen |
Assignee | Radamantis Torres-Lechuga |
Created | 2014-11-12T13:03:05.000+0000 |
Updated | 2016-03-08T07:37:23.000+0000 |
Description
The following test case shows that the
color
property of a Ti.UI.Label
*sometimes* overrides color set in the Attributed String, while I expect the color always to be the default.
Test Case
Remove the comments beforetop:20
and you'll see *ipsum* is no longer red, but green like the rest of the text.
var win = Titanium.UI.createWindow({
backgroundColor: '#ddd',
});
win.add(Ti.UI.createLabel({
// top: 20,
color: 'green',
attributedString: Ti.UI.iOS.createAttributedString({
text: 'Bacon ipsum dolor',
attributes: [{
type: Ti.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,
value: 'red',
range: [6, 5]
}, {
type: Ti.UI.iOS.ATTRIBUTE_FONT,
value: {
fontSize: 17
},
range: [6, 5]
}]
})
}));
win.open();
The same is probably true for TextField
and TextArea
as well.
No comments