Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Trouble looping images in scrollable view

$
0
0

I've created an image carousel using the following code. I'd like to be able to view the images on either side of the current selected image as they scroll on and off the screen as it currently only has a square viewing area that only shows a small area and also loop the images so you can keep scrolling left or right without reaching the end as it currently does. I've tried various code but can't find what I need to do it. Any help?

var imgArr = [ 'orderScreen/images/AburiChashu.jpg', 'orderScreen/images/AburiChickenCheese.jpg', 'orderScreen/images/AburiDuck.jpg', 'orderScreen/images/AburiHotate.jpg', 'orderScreen/images/AburiMarbledBeef.jpg', 'orderScreen/images/AburiSalmon.jpg', 'orderScreen/images/AburiVolcanoRoll.jpg', 'orderScreen/images/AburiVolcanoShip.jpg', ], VU = [];

for (var i = imgArr.length - 1; i >= 0; i--){

var v  = Ti.UI.createView({
    backgroundImage:imgArr[i]
});

VU.push(v);

};

var scrollVu = Ti.UI.createScrollableView({ views:VU, cacheSize: 9, showPagingControl: false, clipMode: Titanium.UI.iOS.CLIP_MODE_DISABLED, center: { x: "50%", y: "25%" }, height: "22%", width: "40%" });


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>