I have a ImageView in which i load an image taken with the camera. But since this image view can take up quite some height, i thought that it would be better to place the ImageView inside a ScrollView. So that the user can pan through the image instead.
So i created all those windows, but for some reason the ScrollView doesn't work when the image is loaded.
var viewCamImage = Ti.UI.createScrollView({ layout: 'vertical', width: '80%', height: '200dp' }); var camImage = Ti.UI.createImageView({ top: '0dp', width: '100%', height: 'auto' }); viewCamImage.add(camImage); win.add(viewCamImage);The image is placed inside the ImageView, and i can clearly see that the image is larger than the '200dp' specified in the height property of the ScrollView. But for some reason the ScrollView isn't working. I can't scroll down...
It does work however, when i place textfields inside the ScrollView. It's just that it doesn't work with my ImageView. Anyone any idea how to solve this problem..??
1 Answer
Accepted Answer
Hi David
Add these to your scrollView
contentWidth: 'auto', contentHeight: 'auto', showVerticalScrollIndicator: true, showHorizontalScrollIndicator: true,So yours becomes
var viewCamImage = Ti.UI.createScrollView({ contentWidth: 'auto', contentHeight: 'auto', showVerticalScrollIndicator: true, showHorizontalScrollIndicator: true, layout: 'vertical', width: '80%', height: '200dp' });This tells the scroll view how to handle the content that sits inside it. You can play with the values, but these work in most cases.
Your Answer
Think you can help? Login to answer this question!