I have a window with a scrollView with vertical layout, the scrollView contains several elements (including a tableView and a picture) and I do not know the exact hight of all those elements.
This is how I create the scrollView:
var scrollView = Ti.UI.createScrollView({ top: '45dp', width: '320dp', height: '410dp', contentHeight: 'auto', contentWidth: '320dp', scrollType: 'vertical', layout: 'vertical', showVerticalScrollIndicator: true });When the window is opened the scrollView scrolls to the bottom for some reason, so the user sees the bottom part of the content of the scroollView. However, I would like it to stick to the top, so users could browse the scrollView contents from the top.
I tried to call scrollView.scrollTo(0,0); or scrollView.setContentOffset({x:0, y:0}); , but it does not help. Any idea how to fix that? I would appreciate all the help!
1 Answer
OK, looks like that was happening because I had a TableView inside of the ScrollView. Had to re-do the window to get rid of one of those, and everything is fine now.
Your Answer
Think you can help? Login to answer this question!