我目前正在开发一个需要水平滚动视图来获取负值并能够向左滚动的项目。这可能吗?这是我现在的代码:
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');
让我知道是否需要更多代码(图像随机位置的增量系统,最左边和最右边的跟踪等)。
截至目前,房屋已创建,但是一旦房屋向左(或实际上是向右)太远,scrollView 就不会滚动。好吧,在此之前它也不会滚动,但我不需要它。
所有帮助表示赞赏!