0

I'm currently working on a project that requires a horizontal scrollView to take a negative values and be able to scroll to the left. Is this possible? Here's my code right now:

var gameView = Titanium.UI.createScrollView({
    scrollType:'horizontal',
    horizontalWrap:false,
    height:'25%',
    top:'0%',
    width:'100%',
    contentWidth: 'auto',
    contentHeight: '25%',
    showHorizontalScrollIndicator: true,
});

//Unrelated code here

houseArray[numHouses] = Titanium.UI.createImageView({
    image:'/gameUI/gameWindow/house.png',
    bottom:'0%',
    right: farLeft + (width*.02),   //2%
    height:'auto',
    width:'10%'
});
gameView.add(houseArray[numHouses]);
gameView.setContentWidth('auto');

Let me know if more code is needed (The increment system for the random locations of the images, the tracking of the far left and far right, etc).

As of right now, the houses are created, but once the houses go too far to the left (or the right, actually), the scrollView doesn't scroll. Well, it doesn't scroll before that either, but I don't need it to.

All help appreciated!

Nate
  • 1
  • instead of adding a negative scroll position, why not change the starting position ;) – Rene Pot May 05 '15 at 13:57
  • Hey Rene, thanks for the response. I can't do that - the view needs to automatically change, because as the houses in the view are created, it gradually needs to get wider and wider. Is this a part of the problem? If I were to just change the starting position, then it would limit the farthest to the left the houses can go. Am I understanding your suggestion correctly? – Nate May 05 '15 at 18:43
  • look at it the other way. The starting position is 0, if you need to scroll further to the left, just add content to the left and fix scroll position so for the user nothing changes, but you did in fact add content, and the scroll position also changed – Rene Pot May 05 '15 at 22:14

0 Answers0