[TIMOB-8354] iOS: ScrollView contentWidth is not respected when adding a children with fill behavior
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2012-04-11T20:39:17.000+0000 |
Affected Version/s | Release 2.0.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | tbs-2.1.0 |
Reporter | Allen Yeung |
Assignee | Marshall Culpepper |
Created | 2012-03-28T11:35:11.000+0000 |
Updated | 2017-03-24T18:13:29.000+0000 |
Description
Run the following code:
//Create a Ti.UI.View with scroll view and do not put any content
var win = Ti.UI.createWindow();
win.backgroundColor = 'white';
var scrollView = Titanium.UI.createScrollView({
contentHeight:'auto',
contentWidth:'100',
showVerticalScrollIndicator:true,
showHorizontalScrollIndicator:true
});
var view2 = Ti.UI.createView({
backgroundColor:'red'
})
scrollView.add(view2);
win.add(scrollView);
win.open();
Expected Result:
The red view's height should fill the screen, and the width should be 100 for the view.
Actual Result:
The red view fills the whole screen (width is size of the whole screen)
The minimum height for contentWidth/contentHeight is the size of the scrollview.
IMHO, there are cases when contentWidth/contentHeight should be smaller than scroll view's width/height and I wish that dimension values of scroll view's content could be defined like dimension values of other view-like components (in my opinion, scroll view's content ideally should behave like basic view inside scrollable area). As a workaround, content can be wrapped in basic view (if someone will need it).
Closing ticket as invalid with reference to the above comments.