Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8354] iOS: ScrollView contentWidth is not respected when adding a children with fill behavior

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-04-11T20:39:17.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sn/a
ComponentsiOS
Labelstbs-2.1.0
ReporterAllen Yeung
AssigneeMarshall Culpepper
Created2012-03-28T11:35:11.000+0000
Updated2017-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)

Comments

  1. Allen Yeung 2012-04-11

    The minimum height for contentWidth/contentHeight is the size of the scrollview.
  2. Ivan Skugor 2012-04-12

    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).
  3. Lee Morris 2017-03-24

    Closing ticket as invalid with reference to the above comments.

JSON Source