Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9035] iOS: Issue with with window navigation when window contains a scrollview

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-11T04:37:57.000+0000
Affected Version/sRelease 2.1.0, Release 1.8.2
Fix Version/sRelease 2.0.2, Release 2.1.0, Sprint 2012-10 API
ComponentsiOS
LabelsSupportTeam, api, module_window, qe-testadded
ReporterVarun Joshi
AssigneeVishal Duggal
Created2012-05-07T17:22:29.000+0000
Updated2012-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

FileDateSize
IMG_3865.mov2012-05-07T17:22:29.000+00003266900

Comments

  1. Vishal Duggal 2012-05-16

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/2198
  2. Sabil Rahim 2012-05-17

    master pull merged , keeping ticket open for the 2.0.X PR
  3. Natalie Huynh 2012-05-18

    Tested with 2.0.2.v20120517153200 on iPhone 4s 5.1
  4. Anshu Mittal 2012-07-11

    Reopening to update labels

JSON Source