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

Android: View with borderRadius won't show up semi-transparent

    Details

      Description

      Problem:
      A view that has a borderRadius won't respect the backgroundColor transparency. It will show up as a solid color.

      Code:

      var win = Ti.UI.createWindow({
      	backgroundColor: '#fff'
      });
       
      var v1 = Titanium.UI.createView({
      	backgroundColor: 'rgba(0,0,0,0.5)',
      	height: 100,
      	width: Ti.UI.FILL,
      	borderRadius: 20
      });
      win.add(v1);
      win.open();
      

      Affected versions
      tested 7.0.0.GA to 7.3.1.GA and all versions are affected by the bug

      Device
      HTC A9, Android 7

      Workaround:
      Using a second view inside the rounded view with a transparent background works:

      var win = Ti.UI.createWindow({
      	backgroundColor: '#fff'
      });
       
      var v1 = Titanium.UI.createView({
      	height: 100,
      	width: Ti.UI.FILL,
      	borderRadius: 20
      });
      var v2 = Titanium.UI.createView({
      	backgroundColor: 'rgba(0,0,0,0.5)',
      	height: 100,
      	width: Ti.UI.FILL
      });
       
      v1.add(v2);
      win.add(v1);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ybanev Yordan Banev
                Reporter:
                michael Michael Gangolf
                Reviewer:
                Gary Mathews
                Tester:
                Sohail Saddique
              • Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code