Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8898] Android: Support FILL behavior on contentWidth/contentHeight property of scroll view

GitHub Issuen/a
TypeImprovement
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2017-10-11T23:57:22.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 6.3.0
ComponentsAndroid
Labelsandroid, core, scrollview
ReporterAllen Yeung
AssigneeJoshua Quick
Created2012-04-26T11:18:59.000+0000
Updated2017-10-23T21:27:09.000+0000

Description

var win = Ti.UI.createWindow({
    backgroundColor:'white'
});
 
var scrollView =  Ti.UI.createScrollView({
    top:10,
    left:5,
    layout:'vertical',
    scrollType: 'vertical',
    contentHeight:Ti.UI.FILL
    // contentWidth:'auto'
});
  
var things = [
    'item1',
    'item2',
    'item3',
    'item4',
    'item5',
    'item6' ];
  
for (var i = 0;  i < things.length;  i++) {
  
    var view = Ti.UI.createView({
        height: 140,
        width: 90,
        top: 10,
        left: 10,
        backgroundColor: '#CCC'
    });
  
    scrollView.add(view);
  
};
 
win.add(scrollView);
 
win.open();
Expected results: The contentHeight should be the size of the scroll view (which prevents it from scrolling) Actual results: The contentHeight follows SIZE behavior and is scrollable since the children's height is bigger than the scroll view height

Comments

  1. Shameer Jan 2013-03-02

    Its an invalid problem,because it questioning 'scrollbar' function which created for scrolling purpose.So it will function when it contains children more than its size.It seems that its a problem of beyond logic.
  2. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to the above comments.
  3. Joshua Quick 2017-10-04

    Re-opening since this is a legit issue. ScrollView "contentWidth" and "contentHeight" properties do not currently support Ti.UI.FILL or Ti.UI.SIZE on Android. Setting the priority to "Low" since supporting Ti.UI.FILL isn't practical because it would make the ScrollView unscrollable.
  4. Joshua Quick 2017-10-09

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/9513
  5. Lokesh Choudhary 2017-10-10

    FR Passed for master. Waiting for backport.
  6. Joshua Quick 2017-10-11

    PR (6.3.x): https://github.com/appcelerator/titanium_mobile/pull/9521
  7. Lokesh Choudhary 2017-10-11

    FR passed for backport. PR merged.
  8. Lokesh Choudhary 2017-10-23

    Verified the fix in SDK 7.0.0.v20171023120246 & 6.3.0.v20171018084007. Closing. Studio Ver: 4.10.0.201709271713 OS Ver: 10.12.3 Xcode Ver: Xcode 8.3.3 Appc NPM: 4.2.10-2 Appc CLI: 6.3.0-master.15 Ti CLI Ver: 5.0.14 Alloy Ver: 1.10.6 Node Ver: 7.10.1 Java Ver: 1.8.0_101 Devices: ⇨ google Nexus 5 — Android 6.0.1 ⇨ google Pixel — Android 7.1.1

JSON Source