Problem
Setting Ti.UI.createScrollView.height to Ti.UI.SIZE causes the scrollView to take up the entire screen.
If navBarHidden:true is set in app.js, a scrollView whose contents are minor will now scroll. This did not occur in Android 2.2.
Steps to Reproduce
Make a project with the below app.js.
Run in Android 4.0 emulator
You will see that most of the screen (excluding the custom navbar) is red. If you click and drag, you will see it scroll even though the components are very minor.
One other point of interest, I added a label at the bottom of the window, but it is not visible since the scrollview wants to take up the entire parent.
var win = Ti.UI.createWindow({
backgroundColor: '#7B6700',
exitOnClose:true,
layout:'vertical',
navBarHidden:true
});
var NavBarView = Ti.UI.createView({height: '25dp',
top:0,
backgroundColor: 'green',
width:'100%'});
var View1 = Ti.UI.createScrollView({left:'3dp',
right:'3dp',
height: Ti.UI.SIZE,
showVerticalScrollIndicator:true,
scrollType:'vertical',
layout:'vertical',
backgroundColor: 'red',
showHorizontalScrollIndicator:false,
touchEnabled: true
});
var button = Ti.UI.createButton({title: 'Click',
width: '100dp',
height: '50dp'
});
button.addEventListener('click', ButtonClick);
function ButtonClick(e)
{
Ti.API.info('View1 height: ' + View1.size.height);
}
Label1 = Ti.UI.createLabel({text:'Label 1'});
View1.add(button);
win.add(NavBarView);
win.add(View1);
win.add(Label1);
win.open();
HD ticket: http://support.appcelerator.com/tickets/APP-225923/
Verified fix with Titanium Studio, build: 2.1.0.201206251749 Titanium SDK: 2.1.0.v20120626104306 Android 4.0 emulator
Verified fix with SDK 2.1.0.GA Thanks
Reopening to update labels.