var win = Ti.UI.createWindow({
fullscreen: false
});
var label = Ti.UI.createLabel({
bottom: 20,
color: 'white',
text: "A label in the window"
});
win.add(label);
var v = Ti.UI.createView({
bottom: 10,
height: 100,
width: 100,
opacity: 0.5,
backgroundColor: 'blue'
});
var b = Ti.UI.createButton({
top: 10,
title: "change view backgroundColor"
});
b.addEventListener("click", function(){
v.backgroundColor = "yellow";
});
var b1 = Ti.UI.createButton({
top: 110,
title: "remove view"
});
b1.addEventListener("click", function(){
win.remove(v);
});
var b2 = Ti.UI.createButton({
top: 210,
title: "add view"
});
b2.addEventListener("click", function(){
win.add(v);
});
win.add(b);
win.add(b1);
win.add(b2);
win.add(v);
win.open();
Steps to reproduce:
1. Run the above code. Should see a translucent blue view on the screen.
2. Click the button "change view backgroundColor".
Actual behavior: The view becomes opaque yellow.
Expected behavior: The view becomes translucent yellow.
Note: if click the button "remove view" and then "add view", we can see the view becomes translucent yellow.
PR: https://github.com/appcelerator/titanium_mobile/pull/4418
This bug only happens on 2.3 devices. For FR, please run the test case on 2.3, 3.x and 4.x devices.
Opacity is working fine when backgorundColor is changed. Verified fix on: Device : Google Nexus 7, Android Version: 4.3 Device: Samsung Galaxy Note, Android version: 2.3.6 SDK: 3.2.0.v20131010163242 CLI version : 3.2.0 OS : MAC OSX 10.8.4 Alloy : 1.2.2 Appcelerator Studio, build: 3.2.0.201310092427 XCode : 5