[TIMOB-5572] MobileWeb: Incorrect work of contentOffset property in the scrollView object
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-06T06:25:10.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | MobileWeb |
Labels | n/a |
Reporter | Misha Vasko |
Assignee | Maxim Negadaylov |
Created | 2011-06-06T03:23:35.000+0000 |
Updated | 2017-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';
})
Closing ticket as fixed.