[TIMOB-9595] Android: ScrollView: More than one view on a scrollview shows up only one view
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-06-18T11:14:01.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | api, qe-and060112, regression |
Reporter | Satyam Sekhri |
Assignee | Neeraj Gupta |
Created | 2012-06-17T06:21:51.000+0000 |
Updated | 2017-03-24T18:09:53.000+0000 |
Description
A scrollview that shows more than one view, does not show up correctly. It shows up only one view that spans the complete height of the screen.
Regression. The issue does not occur on 2.0.2
Steps to reproduce:
1. Create an application with code below
2. Launch application
Actual: Only view 1 is shown on the screen and spans the complete height of the screen
Expected: Two views should show up
var _window = Ti.UI.createWindow({
backgroundColor:'#000'
})
var scrollview=Ti.UI.createScrollView({
contentWidth: 'auto',
contentHeight: 'auto',
showVerticalScrollIndicator: true
})
var view = Ti.UI.createView({
layout : 'vertical',
width: 400,
height: 'auto',
backgroundColor : 'green'
});
scrollview.add(view);
var view1 = Ti.UI.createView({
layout : 'vertical',
backgroundColor : 'red',
height:'auto'
});
var view2 = Ti.UI.createView({
layout : 'vertical',
backgroundColor : 'red',
height:'auto'
});
var label1 = Ti.UI.createLabel({
text:"View1"
})
var label2 = Ti.UI.createLabel({
text:"View2"
})
view1.add(label1);
view2.add(label2);
view.add(view1);
view.add(view2);
_window.add(scrollview);
_window.open();
This is correct behavior. When you set height to auto, the view fills its parent. The bevahior in 2.0.2 is incorrect. This is documented here: https://wiki.appcelerator.org/display/guides2/UI+Composite+Layout+Behavior+Spec#UICompositeLayoutBehaviorSpec-ScrollView%22auto%22 Closing bug as invalid.
Closing ticket as invalid with reference to the above comments.