Changing orientation, scrollView vertical scroll might not work, depending on height property
- Create a scrollView and add objects to it
- Be sure the scrollView height it's lower than the screen height in portrait (so it's not scrolling in portrait mode) but higher than screen height in landscape (where it should scroll)
Result: when turned to landscape, scrollView it's not scrolling.
This is reproducible only with latest 2.1 master SDK.
See attached code below. Please note that changing 'stmtView' view height to a fixed number (for example 450) then the issue it's not reproducible and scrollView scroll down as expected.
var win = Ti.UI.createWindow({
backgroundColor:'white',
title:'test'
});
win.orientationModes=[
Titanium.UI.PORTRAIT,
Titanium.UI.LANDSCAPE_LEFT,
Titanium.UI.LANDSCAPE_RIGHT
];
var view = Ti.UI.createView({
height:205,
backgroundColor:'green',
top:0
});
win.add(view);
var stmtScrollView = Ti.UI.createScrollView({
contentWidth : 'auto',
// contentHeight : 'auto',
top : 0,
showVerticalScrollIndicator : true,
showHorizontalScrollIndicator : false//true
});
var stmtView = Ti.UI.createView({
top : 0,
bottom : 20,
height : Ti.UI.SIZE, //450, // setting a fixed number, like 450, scrollView scroll fine in landscape
backgroundColor:'gray',
left : 0,
right : 0,
//width:'100%',
layout : 'vertical'
});
stmtView.top = view.height;
var subNavViewSectionTitleLabel = Titanium.UI.createLabel({
top : 20,
height : 'auto',
left : '5%',
right : '3.1%',
color : '#363636',
text : 'Test scrollView scroll',
font : {
fontfamily : 'Helvetica Neue',
fontSize : 20,
fontWeight : 'bold'
}
});
var callBtn = Ti.UI.createButton({
top : 50,
left : '5%',
height : 260,
right : '4.1%',
title : 'Red button',
visible : true,
backgroundColor : 'red',
borderRadius : 8,
font : {
fontSize : 19,
fontWeight : 'bold',
fontFamily : 'Helvetica Neue'
},
color : '#FFFFFF'
});
stmtView.add(subNavViewSectionTitleLabel);
stmtView.add(callBtn);
stmtScrollView.add(stmtView)
win.add(stmtScrollView);
win.open();
Can not reproduce with latest master on HTC Sensation (2.3.4).
Closing this ticket as the issue cannot be reproduced.