[ALOY-1589] ListItem having a Label with AttributedString is not working
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2017-11-20T18:39:01.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK |
Labels | n/a |
Reporter | ankur garha |
Assignee | Bruce Wayne |
Created | 2017-09-24T06:05:34.000+0000 |
Updated | 2018-07-27T12:19:04.000+0000 |
Description
<ListView id="listView" defaultItemTemplate="result">
<Templates>
<ItemTemplate name="result">
<Label bindId="title" id="title" />
</ItemTemplate>
</Templates>
<ListSection id="section"></ListSection>
</ListView>
var snippet = "Test string";
var formatter = Ti.UI.createAttributedString({
text : snippet,
attributes : [{
type : Titanium.UI.ATTRIBUTE_FOREGROUND_COLOR,
value : 'red',
range : [0, 4]
}]
});
var item = {
snippet : {
text : snippet,
attributedString : formatter
},
properties : {
accessoryType : Titanium.UI.LIST_ACCESSORY_TYPE_NONE
},
};
$.section.appendItems([item]);
It's always giving an error like this :-
[ERROR] : Script Error: {
[ERROR] : column = 32;
[ERROR] : line = 223;
[ERROR] : message = "Invalid type passed to function";
[ERROR] : nativeLocation = "-[TiUILabel setAttributedString_:] (TiUILabel.m:491)";
[ERROR] : nativeReason = "expected: TiUIAttributedStringProxy, was: NSNull";
[ERROR] : stack = "[native code]\nrefresh\nController\ncreateController\ngoToInspectionPanel\n";
[ERROR] : }
Attachments
File | Date | Size |
---|---|---|
Simulator Screen Shot - iPhone 7 Plus - 2017-11-09 at 12.48.59.png | 2017-11-09T20:49:49.000+0000 | 70709 |