Problem
Calling "hide()" on a button doesn't hide the button if it is called before the window "open" event fires.
Sample Code
var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
win.open();
var hiddenButton = Ti.UI.createButton({
title: 'If you can see me, FAIL!',
height: 40, width: 90,
top: 45, left: 225,
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(hiddenButton);
hiddenButton.hide();
// Workaround: uncomment the following 3 lines and the button will be hidden.
//win.addEventListener('open', function() {
// hiddenButton.hide();
//});
Workaround
Listen for the 'open' event on the window, and call "hide()" then. See the commented code at the bottom of the code sample above to see this in action.
Associated Helpdesk Ticket
http://appc.me/c/APP-321235
The workaround worked just fine for me. Thanks for the fix.
Closing ticket as fixed.