[TIMOB-9572] Android: Views: The visible property of a view is undefined by default
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-17T22:57:23.000+0000 |
Affected Version/s | Release 2.1.0, Release 3.1.0 |
Fix Version/s | 2013 Sprint 12 API, 2013 Sprint 12, Release 3.2.0 |
Components | Android |
Labels | api, module_view, qe-and060112, qe-testadded |
Reporter | Satyam Sekhri |
Assignee | Biju pm |
Created | 2012-06-15T11:40:06.000+0000 |
Updated | 2014-03-12T10:36:49.000+0000 |
Description
The default value of a view added to a window is "undefined".
This is not a regression. The behavior exists as far as 1.8.2
Steps to reproduce:
1. Create an application with code below and launch the application
2. Click on Show/Hide button
Actual: An alert with value "undefined" is shown which is the value of visible property of view.
Expected: The value should be returned as "true"
var _window = Ti.UI.createWindow({
backgroundColor:'white'
});
var view = Ti.UI.createView({
backgroundColor:'red',
width:100,
height:100,
top:20
});
_window.add(view);
var b = Ti.UI.createButton({
title:'Show/hide',
width:140,
height:40,
top:160
});
b.addEventListener('click', function() {
alert('Visible: '+view.visible);
if (view.visible) {
view.hide();
}
else {
view.show();
}
});
_window.add(b);
_window.open();
Issue reproduces with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) Android Emulator: Android SDK version: 2.2
Set the visible property of a view is true https://github.com/appcelerator/titanium_mobile/pull/4387
Closing for android and opened new bug for iOS. Verified the fix with: Appc-Studio: 3.2.0.201310181700 Sdk:3.2.0.v20131018154951 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Samsung Note(v2.3.6),iphoneSimulator(v7) Xcode: 5 visible property of view is not undefined by default now it returns boolean value.(true/false) Closing this issue for android but have opened new issue for iOS TIMOB-15543