manumaticx / TiAndroidFlip

Android FlipView for Titanium
MIT License
13 stars 9 forks source link

removeView() doesn't work with index #2

Closed AppWerft closed 9 years ago

AppWerft commented 9 years ago

Hi Manu,

I try to build an infinity flip view. After flipevnt.

this is my workaround:

var length = FlipView.getViews().length;
if (_event.index == length - 2) {
// remove the dummy on end:
FlipView.removeView(FlipView.getViews()[length-1]);
// add a new one:
FlipView.addView(require('ui/eventlist')(length - 1));
// ad a new dummy
FlipView.addView(Ti.UI.createView());
manumaticx commented 9 years ago

The API is basically the same as Ti.UI.ScrollableView. On Android, removeView by index doesn't work on ScrollableView either. I could implement this but if it isn't really necessary I would like to close this. The workaround is using an array of references to the views.