Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1009] ListView does not allow attributedString to be set on label

GitHub Issuen/a
Resolution Date2014-03-12T05:23:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
LabelsattributedString, listview
ReporterJerod Fritz
AssigneeRitu Agrawal


*Overview* I would like to use the attributedString property to apply styling to a specific range of text inside a label but there is a context problem *Steps to Reproduce* Use the code below to create a ListView and apply a TiUIiOSAttributedString to the attributedString property of the label via the binded id
<ListView id="listView" defaultItemTemplate="result">
    <ItemTemplate name="result">
      <View id="row">
        <Label  bindId="snippet" id="snippet" />
  <ListSection id="section"></ListSection>
var snippet = "Test string";
var formatter = Titanium.UI.iOS.createAttributedString({
  text : snippet,
  attributes : [{
    value : 'yellow',
    range : [0, 4]

var item = {
  snippet : {
    text : snippet,
    attributedString : formatter
  properties : {
    height : Ti.UI.SIZE,
    accessoryType : 1,
    itemId : 0,

*Observed Behavior* The attributed string is ignored and a WARN is generated in the console that reads
[WARN] :   Creating [object TiUIiOSAttributedString] in a different context than the calling function.
*Expected Behavior* The example allows me to style the listitem's label showing "Test string" with "Test" atop a yellow background.


  1. Ritu Agrawal 2014-03-11

    Can you please attach the runnable code so that we can try to reproduce the issue?
  2. Jerod Fritz 2014-03-11

    Ritu, In creating the fully runnable code I was unable to reproduce so my context issue must be something I'm doing. My test code uses the attributedString fine. Apologies for not doing that first. Please close this ticket as invalid. Thanks, Jerod

JSON Source