<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] : }
Looks related to AC-1009 which was resolved by the creator of the ticket. Please ensure you cleaned your build-directory and watch out for possible typos. If it's still not working after that, we can move it to the Alloy-space, thx!
Hello [~speedyankur@gmail.com], Can you please follow up on [~hknoechel], comment above? Let us know if you have done the things properly. Thanks.
Hello [~speedyankur@gmail.com], Any update on your issue?
No its still not working for me.
Works for me with SDK 6.3.0.GA, CLI 6.3.0. Above test app launched with no error, please see attached screen shot.
Please reopen with more information if occurs.
Using 7.1.1.GA the error is reproducible if template with a Ti.UI.TextArea is set with Ti.UI.AttributedString in one Ti.UI.ListItem and plain string value in another.