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

Android: Animating a Label or Button with borderRadius bugs the backgroundColor animation.

    Details

      Description

      Adding the property borderRadius to a label or a button and animating the backgroundColor makes it always go from white to the animated color instead of animating from the view background color to the new color.

      Test case:

      var win = Ti.UI.createWindow({
              layout : 'vertical',
              width : Ti.UI.FILL,
              height : Ti.UI.FILL
          });
       
          var label = Ti.UI.createLabel({
              width :Ti.UI.SIZE,
              font : {
                  fontSize : 14
              },
              text : 'Should go from blue to black',
              textAlign : 'center',
              color : 'white',
              backgroundColor : 'blue',
              borderRadius : 20
          });
          
          label.addEventListener('click',function() {
              label.animate({
                  backgroundColor : '#000',
                  duration : 10000
              });
          });
          
          win.add(label);
          win.open();
      

      The expected behavior is for the background to go from blue to black but instead it goes from white to black. If you remove the borderRadius then it works as expected.
      A workaround is to wrap the label/button in a view.

        Attachments

        1. 1562230320886.JPEG
          1562230320886.JPEG
          12 kB
        2. 1562230320932.JPEG
          1562230320932.JPEG
          12 kB
        3. 1562408449852.JPEG
          1562408449852.JPEG
          18 kB
        4. 1562408449904.JPEG
          1562408449904.JPEG
          17 kB
        5. ui_bug_brorderradius.gif
          ui_bug_brorderradius.gif
          854 kB

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              remo.loaiza remo.loaiza
              Reviewer:
              Gary Mathews
              Tester:
              Sohail Saddique
            • Watchers:
              7 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 Source Code