Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9595] Android: ScrollView: More than one view on a scrollview shows up only one view

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-06-18T11:14:01.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsapi, qe-and060112, regression
ReporterSatyam Sekhri
AssigneeNeeraj Gupta
Created2012-06-17T06:21:51.000+0000
Updated2017-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();

Comments

  1. Hieu Pham 2012-06-18

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

    Closing ticket as invalid with reference to the above comments.

JSON Source