Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5572] MobileWeb: Incorrect work of contentOffset property in the scrollView object

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-06-06T06:25:10.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsMobileWeb
Labelsn/a
ReporterMisha Vasko
AssigneeMaxim Negadaylov
Created2011-06-06T03:23:35.000+0000
Updated2017-03-09T20:47:55.000+0000

Description

When contentOffset property of the scrollView object is defined it adds the x and y values to the scrollView size instead of creating offset into the scrollView.
win = Ti.UI.currentWindow;

var scrollView = Ti.UI.createScrollView({
left: 10,
top: 10,
width: 300,
height: 300,
focusable: true,
backgroundSelectedColor: 'red',
backgroundColor: '#FFD',
contentHeight: 100,
contentWidth: 100,
contentOffset: {x:150, y:150}
});

win.add(scrollView);

var button1 = Ti.UI.createButton({
	left: 10,
	top: 10,
	title: 'button1',
	width: 100,
	height: 100
})

var button2 = Ti.UI.createButton({
	left: 10,
	top: 120,
	title: 'button2',
	width: 500,
	height: 100
})
var button3 = Ti.UI.createButton({
	left: 10,
	top: 240,
	title: 'button3',
	width: 100,
	height: 100
})
var button4 = Ti.UI.createButton({
	left: 800,
	top: 800,
	title: 'button4',
	width: 100,
	height: 100
})

scrollView.add(button1);
scrollView.add(button2);
scrollView.add(button3);
scrollView.add(button4);

button1.addEventListener('click',function(){
	scrollView.showHorizontalScrollIndicator = false;
	button1.title = 'changed';
})


button2.addEventListener('click',function(){
	scrollView.showVerticalScrollIndicator = false;
	button2.title = 'changed';
})

button3.addEventListener('click',function(){
	scrollView.focusable = false;
	button3.title = 'changed';
})

button4.addEventListener('click',function(){
	scrollView.scrollTo(20,20);
	button4.title = 'changed';
})

Comments

  1. Lee Morris 2017-03-09

    Closing ticket as fixed.

JSON Source