[TIMOB-8334] iOS: modal window - orientation change causes the top 44px to be hidden under the nav bar
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-04-04T09:23:30.000+0000 |
Affected Version/s | Release 1.8.2 |
Fix Version/s | Release 2.0.0 |
Components | iOS |
Labels | module_window, qe-testadded |
Reporter | Jon Alter |
Assignee | Neeraj Gupta |
Created | 2012-03-27T13:57:07.000+0000 |
Updated | 2014-06-19T12:44:43.000+0000 |
Description
If you open a modal window and then rotate the simulator/device, you will see that the top 44px is covered by the navBar.
Steps to reproduce
Step 1: run the code below Step 2: notice the text at the top of the window Step 3: rotate the simulator or device Step 4: notice that the text is missing (if you pull down on the window you can see the text is under the navBar);
var win = Ti.UI.createWindow({
modal:true,
backgroundColor: 'white'
});
var scrollView = Ti.UI.createScrollView({
contentHeight: 1030,
contentWidth: 1030,
backgroundColor: 'green'
});
var label = Ti.UI.createLabel({
text: 'THIS IS SOME TEXT',
height: 'auto',
width: 'auto',
top: 0
});
win.add(scrollView);
scrollView.add(label);
win.open();
Workaround
function handleOrientationChange() {
Ti.Gesture.removeEventListener('orientationchange', handleOrientationChange);
scrollView.top = 44;
}
Ti.Gesture.addEventListener('orientationchange', handleOrientationChange);
This issue is already fixed on master(2.0.0) by [PR1490](https://github.com/appcelerator/titanium_mobile/pull/1490)
Closing bug. Verified fix on: SDK build: 2.0.0.v20120328000206 Titanium Studio, build: 2.0.0.201203271933 xcode: 4.3 Device: iphone 4 (5.1) Note to QE: When porting: * Add the following code in tiapp.xml under
* In Ti.UI.createScrollView(), change contentHeight and contentWidth to 'auto'
Reopening/closing to add/remove labels