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

Android: default value of borderWidth of view is not respected, if borderRadius is set (but no borderColor)

    Details

    • Sprint:
      2018 Sprint 24

      Description

      According to the doc (https://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-borderWidth), default value of borderWidth of view should be 0 as long as borderColor is not set. However, looks like this default value is not respected on Android, if borderRadius of the view is defined.

      Sample code to reproduce (paste the following code to a new mobile app project and run it on Android):

      var win = Titanium.UI.createWindow({
      	height: Titanium.UI.FILL,
      	width: Titanium.UI.FILL,
      	layout: 'vertical',
      	backgroundColor: '#FFFFFF'
      });
       
      var view1 = Titanium.UI.createView({
      	top: 20,
      	height: 100,
      	width: 280,
      	backgroundColor: '#000000'
      	// No borderRadius
      });
      view1.add(Titanium.UI.createLabel({
      	color: '#FF0000',
      	text: 'Click here to test!'
      }));
      view1.addEventListener('click', function() {
      	view1.setBackgroundColor('#00FFFF');
      });
       
      var view2 = Titanium.UI.createView({
      	top: 20,
      	height: 100,
      	width: 280,
      	backgroundColor: '#000000',
      	borderRadius: 5
      });
      view2.add(Titanium.UI.createLabel({
      	color: '#FF0000',
      	text: 'Click here to test!'
      }));
      view2.addEventListener('click', function() {
      	view2.setBackgroundColor('#00FFFF');
      });
       
      win.add(view1);
      win.add(view2);
       
      win.open();
      

      After launching the sample app, click the two buttons (views) on the screen one by one and their background colour will change. Then it can be clearly observed that the actual border width of the second view is not 0 (the default value specified in doc), since we can see black border around it.

      By the way, on iOS the actual behaviour matches well with the doc. There is no black border around any view after the background colour gets changed.

        Attachments

          Activity

            People

            • Assignee:
              ybanev Yordan Banev
              Reporter:
              mwenli Ma Wenli
              Reviewer:
              Christopher Williams
              Tester:
              Keerthi Mahalingam
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code