Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-18502

iOS AttributedString with ATTRIBUTE_LINK and ATTRIBUTE_FOREGROUND_COLOR together

    Details

      Description

      Problem Description

      You can't mix the use of ATTRIBUTE_LINK and ATTRIBUTE_FOREGROUND_COLOR. Each one works fine by itself.

      Steps to reproduce

      1. Create a new mobile project classic titanium
      2. Add this code to app.js:

      var win = Titanium.UI.createWindow({
          backgroundColor: '#ddd',
      });
      win.open();
      var text =  'My Site Is !Google!';
      var attr = Titanium.UI.iOS.createAttributedString({
                      text: text
                  });
                 attr.addAttribute({
                      type: Titanium.UI.iOS.ATTRIBUTE_LINK,
                  	value: 'https://www.google.com.bd',
                  	range: [text.indexOf('!Google!'), ('!Google!').length]
                  });            
                 attr.addAttribute({
                      type: Titanium.UI.iOS.ATTRIBUTE_FOREGROUND_COLOR,
                  	value: "green",
                  	range: [text.indexOf('!Google!'), ('!Google!').length]
                  });
      var label = Titanium.UI.createLabel({
          left: 20,
          right: 20,
          height: Titanium.UI.SIZE,
          attributedString: attr
      });
      win.add(label);
      

      3. Run in a device

      Actual results

      As you can see, if you mix ATTRIBUTE_FOREGROUND_COLOR and ATTRIBUTE_LINK, the only working will be ATTRIBUTE_LINK.

      Expected results

      being able to mix ATTRIBUTE_LINK and ATTRIBUTE_FOREGROUND_COLOR. Currently, if you do a mix of ATTRIBUTE_BACKGROUND_COLOR and ATTRIBUTE_LINK, it will work just fine.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              virendrapatidar virendra patidar
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-19681
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code