Hi. i have been creating an image slider for android, but i am not achieving what i wanted. i am doing this-
1.) Creating an array of image views (like this)
var viewArr = []; for(var j=0;j<path.length;j++){ var imgv = Titanium.UI.createImageView({url:"../images/"+path[j]}); viewArr.push(imgv); }(the array path[] is having image names)
2.) Create a new ScrollView with createScrollView (like this)
var scrollView = Titanium.UI.createScrollableView({ views:viewArr, });
3.) Pass that array of image views to the ScrollView (in the above code)
5.) Registering the ScrollView for scroll events (like this)
scrollView.addEventListener('scroll', function(e) { Ti.API.info('x'+e.x+'y'+e.y); });
but it doesn't seem to work as whenever i scroll , i get nothing. please help. i have seen kitchen sink app's scroll_view_tab.js and have tried to implement it too, but no positive results.
1 Answer
Hi
I’ve done some code research on creating an Android image carousel. Hope it helps answer your question on implementing an image slider. Please let me know if there’s anything I can add to make a more comprehensive resource for other developers.
http://www.verious.com/board/Giancarlo-Leonio/creating-an-android-image-carousel/
@Veriously
Your Answer
Think you can help? Login to answer this question!