Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8956] Android: When a view backgroundColor is set to transparent, setting the border width and color fills in the whole view with the border color.

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-12T22:00:28.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sRelease 2.1.0
ComponentsAndroid
Labelsapi, module_view, qe-testadded, support
ReporterBetty Tran
AssigneePing Wang
Created2012-05-02T16:11:45.000+0000
Updated2012-08-13T08:07:03.000+0000

Description

Problem

The issue occurs when a view is created with a transparent background color, a border width and a border color. Instead of the background being transparent and the border being the specified color and width, the whole view is filled in with the border color.

Test case

var btnView = Ti.UI.createView({
 left: 10, 
 height: 300, 
 width: 300,
 top: 10,
 backgroundColor: 'transparent',
 borderWidth: 2,
 borderColor: 'red'	
});

var win = Ti.UI.createWindow({
 backgroundColor: 'blue'
});

win.add(btnView);

win.open();

Comments

  1. Ping Wang 2012-05-22

    Test case:
       var win = Ti.UI.createWindow({
        backgroundColor: 'blue'
       });
        
       var view = Ti.UI.createView({
        left: 10, 
        height: 300, 
        width: 300,
        top: 10,
        backgroundColor: 'white',
        borderWidth: 20,
        borderColor: 'red' 
       });
        
        
       var b1 = Ti.UI.createButton({
           top: 350,
           title: "backgroundColor=transparent"
       });
       b1.addEventListener("click", function(){
           view.backgroundColor = 'transparent';
       });
        
       var b2 = Ti.UI.createButton({
           top: 430,
           title: "backgroundColor=white"
       });
       b2.addEventListener("click", function(){
           view.backgroundColor = 'white';
       });
        
       var b3 = Ti.UI.createButton({
           top: 510,
           title: "borderRadius=30"
       });
       b3.addEventListener("click", function(){
           view.borderRadius=30;
       });
       
       var b4 = Ti.UI.createButton({
           top: 590,
           title: "borderRadius=10"
       });
       b4.addEventListener("click", function(){
           view.borderRadius=10;
       });
        
       var b5 = Ti.UI.createButton({
           top: 670,
           title: "borderRadius=0"
       });
       b5.addEventListener("click", function(){
           view.borderRadius=0;
       });
        
       win.add(view);
       win.add(b1);
       win.add(b2);
       win.add(b3);
       win.add(b4);
       win.add(b5);
        
       win.open();
       
    For functional test, click the buttons to change the properties of the view and observe the change of the view.
  2. Ping Wang 2012-05-22

    PR https://github.com/appcelerator/titanium_mobile/pull/2244
  3. Vishal Duggal 2012-05-25

    Fixed by PR https://github.com/appcelerator/titanium_mobile/pull/2244
  4. Eric Merriman 2012-06-18

    Verified fixed with SDK 2.1.0.v20120618102300
  5. Tamila Smolich 2012-07-09

    Reopening issue. Bug still occurs on: Titanium Studio, build: 2.1.1.201207061909 Titanium SDK: 2.2.0.v20120705160241 Devices: Nexus S (4.0.4), Galaxy Nexus (4.0.4), Motorola Xoom (4.0.3)
  6. Vishal Duggal 2012-07-12

    Can not reproduce with either the 2.1.X or master branches. Tested on Android Sim (2.2), Galaxy Nexus(4.0.2) and Motorola Xoom (4.0.3) with both V8 and Rhino
  7. Olga Romero 2012-08-09

    Verified fix with: Titanium Studio, build: 2.1.1.201207271312 Titanium SDK: 2.1.1.v20120727140110 HTC EVO 4.0.3

JSON Source