Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1589

ListItem having a Label with AttributedString is not working

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Titanium SDK
    • Labels:
      None
    • Environment:

      Ti SDK 6.2.0
      IOS

      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

          Activity

            People

            • Assignee:
              batman Bruce Wayne
              Reporter:
              speedyankur@gmail.com ankur garha
            • Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration