Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8731] Android: ScrollView is not properly formatted in the view

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-10-06T20:37:15.000+0000
Affected Version/sRelease 2.0.1, Release 3.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-and040912
ReporterSitara Shylaja
AssigneeEric Merriman
Created2012-04-13T17:37:21.000+0000
Updated2017-10-06T20:37:15.000+0000

Description

In ScrollView ,view should contain 3 rows of Image (4 squares of different sizes apart from each other in each row).One ScrollView is missing and the squares views have no separation. Steps to reproduce: 1: Install and run the app Actual Result: missing a ScrollView in the View.No space between the square views Expected Result: should be able to see all the three ScrollViews in the view
var win = Ti.UI.createWindow({
    backgroundColor: '#fff',
    layout:'vertical'
});
 
function AddViews(params){
    var w = params[0];
    var h = params[1];
    var l = params[2];
    var r = params[3];
    var b = params[4];
     
    var view = Ti.UI.createView({
        width:w,
        height:h,
        left:l,
        right:r,
        backgroundColor:b
    })
     
    return view;
}
 
var sv1 = Ti.UI.createScrollView({
    height:150,
    top : 15,
    left: 0,
    contentWidth: 'auto',
    showVerticalScrollIndicator:false,
    showHorizontalScrollIndicator:false,
    disableBounce:false,
    scrollType: 'horizontal',
    layout:'horizontal',
    backgroundColor:"green"
})
 
sv1.add(AddViews([100,100,10,10,"red"]))
sv1.add(AddViews([30,50,0,0,"red"]))
sv1.add(AddViews([100,70,10,10,"red"]))
sv1.add(AddViews([150,100,0,0,"red"]))
 
var sv2 = Ti.UI.createScrollView({
    height:Ti.UI.SIZE,
    top : 15,
    left: 0,
    contentWidth: 'auto',
    showVerticalScrollIndicator:false,
    showHorizontalScrollIndicator:false,
    disableBounce:false,
    scrollType: 'horizontal',
    layout:'horizontal',
    backgroundColor:"green"
})
 
sv2.add(AddViews([100,100,10,10,"red"]))
sv2.add(AddViews([30,50,0,0,"red"]))
sv2.add(AddViews([100,70,10,10,"red"]))
sv2.add(AddViews([150,100,0,0,"red"]))
 
 
var sv3 = Ti.UI.createScrollView({
    height:Ti.UI.FILL,
    top : 15,
    left: 0,
    contentWidth: 'auto',
    showVerticalScrollIndicator:false,
    showHorizontalScrollIndicator:false,
    disableBounce:false,
    scrollType: 'horizontal',
    layout:'horizontal',
    backgroundColor:"green"
})
 
sv3.add(AddViews([100,100,10,10,"red"]))
sv3.add(AddViews([30,50,0,0,"red"]))
sv3.add(AddViews([100,70,10,10,"red"]))
sv3.add(AddViews([150,100,0,0,"red"]))
 
win.add(sv1);
win.add(sv2);
win.add(sv3);
 
win.open();
note:*Not a regression, the behavior exists as far back as 1.8.2 at least*

Comments

  1. jithinpv 2013-02-23

    This issue can be reproduced in the latest master 3.1.0 and also in last release 3.0.2 . Test Environment: Sdk version: 3.1.0,3.0.2 Device : Android 4.0.4 ,Display Resolution:480x800 In the landscape mode only 2 scrollviews are displayed. But in the portrait mode we can see all the three scrollviews as expected. Even though height of the second scrollview was set as Ti.UI.SIZE it grabs more height.
  2. Joshua Quick 2017-10-06

    Could not reproduce when using Titanium 6.0.2. Behavior matches between Android and iOS for that version. Assumed to be fixed.

JSON Source