[ALOY-1345] iOS Attributed Strings are not showing
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-02-01T17:11:20.000+0000 |
Affected Version/s | alloy 1.7.30 |
Fix Version/s | Release 5.2.0, alloy 1.7.31 |
Components | XML |
Labels | attributedString |
Reporter | Ricardo Ramirez |
Assignee | Feon Sua Xin Miao |
Created | 2016-01-04T21:20:44.000+0000 |
Updated | 2016-02-02T22:26:20.000+0000 |
Description
Issue Description
Using Attributed String for label in Alloy, it is not showing up in iOS. Where as the same is working properly for Android and in classic.Steps to reproduce
//AlloyCreate a new simple project application in alloy
Open the index.xml view
Add the next Label:
<Label>
<AttributedString class="as">
Appcelerator Titanium rocks!
</AttributedString>
</Label>
Open the index.tss Style
Add the next style:
".as" : {
attributes: [
{
type: Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,
value: 'red',
range: [0, 4]
}
]
}
Run
// Classic (Working project)Create a new cassic default application project
Open the app.js file
Replace the content with the next code:
var win = Ti.UI.createWindow({
backgroundColor: "white"
});
var attr = Titanium.UI.createAttributedString({
text: "Appcelerator Rocks"
});
// Underlines text
attr.addAttribute({
type: Ti.UI.ATTRIBUTE_FOREGROUND_COLOR,
value: 'red',
range: [0, 4]
});
var label = Titanium.UI.createLabel({
left: 20,
right: 20,
height: Titanium.UI.SIZE,
attributedString: attr
});
win.add(label);
win.open();
Run
Attachments
File | Date | Size |
---|---|---|
iphone6.png | 2016-01-09T02:22:59.000+0000 | 88358 |
phone5.png | 2016-01-09T02:22:59.000+0000 | 106476 |
Screen Shot 2016-01-08 at 3.52.13 PM.png | 2016-01-08T23:58:36.000+0000 | 63284 |
Screen Shot 2016-01-08 at 7.14.19 PM.png | 2016-01-09T03:20:10.000+0000 | 177220 |