Problem Description
I have a tableview in a window. If I open that window using tab1.open(theWindow), the tableview appears as it should. BUT if I close that window using tab1.close(theWindow) and open it again later using the same tab1.open(theWindow), the tableview quickly shifts up to it's position. It is almost like it is animating 20px when the window is opened. I am NOT using any animations. Sample code below
Actual Results
After the first time, the tableview appears animated.
Expected results
Tableview without animation
Test Case
1. Create new mobile project.
2. Paste this code
//create main window
var window1 = Titanium.UI.createWindow({ navBarHidden:true,tabBarHidden:true });
//create and add button to open window 2
var btn = Ti.UI.createButton({height:100,width:100});
window1.add(btn);
//create window 2 for tableview
var window2 = Titanium.UI.createWindow({ navBarHidden:true,tabBarHidden:true });
//create back button to go back to main menu
var backBtn = Titanium.UI.createButton({height:30,width:50,top:10,left:10});
//create search bar
var search = Titanium.UI.createSearchBar({
showCancel:false
});
//create data for tableview
var theData = [
{ title:"One", hasChild:true },
{ title:"Two", hasChild:true },
{ title:"Three", hasChild:true },
{ title:"Four", hasChild:true },
{ title:"Five", hasChild:true }
];
//create tableview
var menu = Ti.UI.createTableView({
height:405,
top:55,
data:theData,
search:search
});
//add menu and back button to window 2
window2.add(menu);
window2.add(backBtn);
//Set up the Tab Group
var tabGroup = Titanium.UI.createTabGroup();
var tab1 = Titanium.UI.createTab({
title:'window1',
window: window1
});
//Add and open tabgroup
tabGroup.addTab(tab1);
tabGroup.open();
//button click events
btn.addEventListener('click',function(){tab1.open(window2);})
backBtn.addEventListener('click',function(){tab1.close(window2);})
Fixed by PR #1989
Verified fixed with SDK 2.1.0.v20120618102300 on iPad 3.
Reopening to update labels