[TIMOB-9035] iOS: Issue with with window navigation when window contains a scrollview
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-07-11T04:37:57.000+0000 |
Affected Version/s | Release 2.1.0, Release 1.8.2 |
Fix Version/s | Release 2.0.2, Release 2.1.0, Sprint 2012-10 API |
Components | iOS |
Labels | SupportTeam, api, module_window, qe-testadded |
Reporter | Varun Joshi |
Assignee | Vishal Duggal |
Created | 2012-05-07T17:22:29.000+0000 |
Updated | 2012-07-11T13:49:04.000+0000 |
Description
Problem
The contents of the window get off screen and the controls become inaccessible if a scrollview is added to the window. The controls return back to normal after orientation change.
Steps to Reproduce
The first window has a button that opens the second window. The second window has a label and a button. The button on the second window closes the second window. The first time you open the second window the layout is fine. The second time you open the window the label is gone, and you can't click on the button to close the window. The code works if we change the device orientation. Also, switching the view from a scroll view to a plain view resolves the issue.
{noformat}
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var window1 = Ti.UI.createWindow({
orientationModes : [Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.UPSIDE_PORTRAIT],
backgroundColor : '#AA0000',
top : 44,
left : 0,
bottom : 0,
width : '100%'
});
var openButton = Ti.UI.createButton({
title : 'Open Window 2',
height : 44,
width : 150
});
openButton.addEventListener('click', function() {
window2.open();
});
window1.add(openButton);
window1.open();
var window2 = Ti.UI.createWindow({
orientationModes : [Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT, Ti.UI.LANDSCAPE_RIGHT, Ti.UI.UPSIDE_PORTRAIT],
backgroundColor : '#00FF00',
top : 44,
left : 0,
bottom : 0,
width : '100%'
});
/*
* Making the scrollview as a normal view here works fine
*/
var view2 = Ti.UI.createScrollView({
width : '100%',
backgroundColor : '#0000FF',
top : 0,
left : 0,
height:'100%'
});
var closeButton = Ti.UI.createButton({
title : 'Close Window 2',
height : 44,
width : 150,
//left:10,
//top:10
});
closeButton.top = 10;
closeButton.left = 10;
var someTextLabel = Ti.UI.createLabel({
backgroundColor : '#FFFFFF',
text : 'Title Label',
left : 10,
top : 75,
width : Ti.UI.SIZE,
height:Ti.UI.SIZE
});
//someTextLabel.top = 75;
//someTextLabel.left = 10;
closeButton.addEventListener('click', function() {
window2.close();
});
view2.add(closeButton);
view2.add(someTextLabel);
window2.add(view2);
{noformat}
Attachments
File | Date | Size |
IMG_3865.mov | 2012-05-07T17:22:29.000+0000 | 3266900 |
Pull pending https://github.com/appcelerator/titanium_mobile/pull/2198
master pull merged , keeping ticket open for the 2.0.X PR
Tested with 2.0.2.v20120517153200 on iPhone 4s 5.1
Reopening to update labels