Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12124] Android: Show method on a view doesn't work

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-05-04T00:02:08.000+0000
Affected Version/sRelease 2.1.4, Release 3.0.0, Release 3.1.0
Fix Version/s2013 Sprint 09 API, 2013 Sprint 09, Release 3.2.0
ComponentsAndroid
Labelsexalture, module_views, parity, qe-testadded
ReporterNikhil Sharma
AssigneeSunila
Created2012-12-18T21:49:46.000+0000
Updated2014-06-19T12:42:38.000+0000

Description

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();

Attachments

FileDateSize
deviceScreenshot.png2012-12-18T21:49:46.000+000011348

Comments

  1. Shameer Jan 2013-03-11

    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.
  2. Sunila 2013-05-01

    Set 'visible' property regarless of native view is created or not. https://github.com/appcelerator/titanium_mobile/pull/4225
  3. Anshu Mittal 2013-10-14

    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

JSON Source