Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10330] iOS: ScrollView: 'layout' to 'Horizontal' content is being cut-off

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-18T08:43:11.000+0000
Affected Version/sRelease 2.0.2, Release 2.1.1, Release 3.0.0
Fix Version/sRelease 2.1.4, Release 3.0.0, Sprint 2012-20 API, 2012 Sprint 20
ComponentsiOS
LabelsSupportTeam, core, module_scrollView, qe-testadded
ReporterEduardo Gomez
AssigneeVishal Duggal
Created2012-08-06T12:23:21.000+0000
Updated2013-07-18T08:43:11.000+0000

Description

Problem

In ScrollView when we set 'layout' to 'Horizontal' content is being cut-off (iOS_iPad_MIDDLE.jpg) when it goes beyond the bottom of the device screen. The customer relies on a such layout content that should use 'layout' to 'Horizontal' in ScrollView UI element, growing up according the height contents dynamically.

Stripped down simple sample

function createBlock(color) {

	var view = Ti.UI.createView({
		backgroundColor : color,
		width : 400,
		height : 400,
		borderColor : "white"
	});
	return view;
}

var currentWindow = Ti.UI.createWindow();

var scrollView = Titanium.UI.createScrollView({
	backgroundColor : 'red',
	contentWidth : 'auto',
	contentHeight : 'auto',
	top : 0,
	showVerticalScrollIndicator : true,
	showHorizontalScrollIndicator : true,
	layout:'horizontal'
});

var view = Ti.UI.createView({
	width : 'auto',
	height : 'auto',
	layout : 'vertical'
});

view.add(createBlock("blue"));
view.add(createBlock("orange"));
view.add(createBlock("green"));
view.add(createBlock("purple"));
view.add(createBlock("gray"));

scrollView.add(view);

currentWindow.add(scrollView);
currentWindow.open(); 

Attachments

FileDateSize
iOS_iPad_MIDDLE.jpg2012-08-06T12:23:21.000+000056016
iOS_iPad_TOP.jpg2012-08-06T12:23:21.000+000057420

Comments

  1. Vishal Duggal 2012-10-08

    https://github.com/appcelerator/titanium_mobile/pull/3132
  2. Sabil Rahim 2012-10-09

    FR
  3. Ingo Muschenetz 2012-10-31

    Appears Release-2.1.4 not added properly.
  4. Natalie Huynh 2012-11-01

    Tested with 2.1.4.v20121030173408 on iPad 2 5.1
  5. Priya Agarwal 2013-07-18

    Reopening just to update label.
  6. Priya Agarwal 2013-07-18

    Updated label. Closing as fixed. Verified with environment: Studio: 3.1.2.201307121617 Titanium SDK: 3.1.2.v20130710144553 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device:iPad Mini(v6.0) , Galaxy Nexus(4.0.4) Xcode: 4.5.1 Scrollview working properly with layout horizontal, content are not cut.

JSON Source