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

Android: Ti.UI.ImageView#tintColor is multiplied, not replaced (like iOS)

    Details

      Description

      This is an issue that took us a while to track down. And thanks to @miga for the additional check!

      The issue is that the tintColor property of the Ti.UI.ImageView multiply the provided color, instead of actually replacing the color. This results in an unexpected behavior, since the provided color is not what you actually see. This works well on iOS (which is where the tintColor API was introduced first and should be followed here. For other masks, the Ti.UI.MaskedImage can be used, but we need strong parity here!

      Example:

      const window = Ti.UI.createWindow();
      const icon = Ti.UI.createImageView({
          tintColor: 'red',
          width: 30,
          image: 'example.png'
      });
      window.add(icon);
      window.open();
      

      Work-Around:
      Use a Ti.UI.MaskedImage instead.

      const window = Ti.UI.createWindow();
      const icon = Ti.UI.createMaskedImage({
          mask: 'example.png',
          tint: 'red',
          width: 30,
      });
      window.add(icon);
      window.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                hknoechel Hans Knöchel
                Tester:
                Samir Mohammed
              • Watchers:
                6 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