Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8334] iOS: modal window - orientation change causes the top 44px to be hidden under the nav bar

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-04-04T09:23:30.000+0000
Affected Version/sRelease 1.8.2
Fix Version/sRelease 2.0.0
ComponentsiOS
Labelsmodule_window, qe-testadded
ReporterJon Alter
AssigneeNeeraj Gupta
Created2012-03-27T13:57:07.000+0000
Updated2014-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);

Comments

  1. Sabil Rahim 2012-03-27

    This issue is already fixed on master(2.0.0) by [PR1490](https://github.com/appcelerator/titanium_mobile/pull/1490)
  2. Wilson Luu 2012-03-28

    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 :
       <orientation>Titanium.UI.LANDSCAPE_LEFT</orientation>
       <orientation>Titanium.UI.LANDSCAPE_RIGHT</orientation>
       
    * In Ti.UI.createScrollView(), change contentHeight and contentWidth to 'auto'
  3. Michael Pettiford 2012-04-04

    Reopening/closing to add/remove labels

JSON Source