GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-05-04T00:02:08.000+0000 |
Affected Version/s | Release 2.1.4, Release 3.0.0, Release 3.1.0 |
Fix Version/s | 2013 Sprint 09 API, 2013 Sprint 09, Release 3.2.0 |
Components | Android |
Labels | exalture, module_views, parity, qe-testadded |
Reporter | Nikhil Sharma |
Assignee | Sunila |
Created | 2012-12-18T21:49:46.000+0000 |
Updated | 2014-06-19T12:42:38.000+0000 |
If you set the visible property to false on a view and then call the show method it doesn't show the view. It happens if the window to which the view is added is not the first window of the application. It works fine on iOS.
Steps to reproduce
1. Run the below code in your project's app.js.
2. Open the application and click the "New window" button.
3. It opens a second window with blue background color and it doesn't show the view.
Ti.UI.backgroundColor = 'white';
var win = Ti.UI.createWindow({
title : 'win',
backgroundColor : 'white'
});
var button1 = Ti.UI.createButton({
title : "New window"
});
win.add(button1);
button1.addEventListener("click", function() {
var win1 = Ti.UI.createWindow({
title : 'win',
backgroundColor : 'blue',
fullscreen : true
});
var indicatorView = Ti.UI.createView({
visible : false,
backgroundColor : 'black',
height : '20dp',
width : '20dp',
});
win1.add(indicatorView);
indicatorView.show();
//indicatorView.visible = true;
win1.open();
});
win.open();
The problem reproduces with release 3.0.2 and master release 3.1.0 tested on Titanium Studio, build: 3.0.2.201302191606 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 Device: Samsung galaxy s duos Android version: 4.0.4 Android Emulator: Android SDK version: 2.2 iOS iPhone Simulator: iOS SDK version: 6.0 It works fine on iOS.
Set 'visible' property regarless of native view is created or not. https://github.com/appcelerator/titanium_mobile/pull/4225
Verified fix with: Appc-Studio: 3.2.0.201310112258 Sdk:3.2.0.v20131013140318 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Nexus7(4.2), iPhone5(7.0.2) Xcode: 5