nativescript-carousel icon indicating copy to clipboard operation
nativescript-carousel copied to clipboard

Indicator Not Show Correctly When selectedPage changed

Open kentplaza opened this issue 8 years ago • 3 comments

I trying to make the carousel to be loop cycle (mean go to first when reach end or vice versa). Does it support?

For the mean time, I didn't see any function to allow feature above so that I try to write my own code "pageChanged" event as below:

var carousel = page.getViewById("carousel"); carousel.selectedPage = 4;

But I found the indicator not going to show to correct selected item.

kentplaza avatar Mar 01 '17 07:03 kentplaza

What page does it select? Keep in mind that selectedPage is an index. So the first one is 0. If you have 5 pages, the index of the last one would be 4.

The infinite loop is only available on iOS, not Android for the time.

manijak avatar Mar 01 '17 08:03 manijak

Yes. So that;s why i doing on my own code. If reach to last page, I will set carousel.selectedPage = 0. The page will go to first page but the indicator will showing at last position.

kentplaza avatar Mar 01 '17 08:03 kentplaza

Hmm.. I don't think you'll be able to do this outside the plugin. It is currently not possible to change the selected indicator while the pageChange event is running.

I'll have to take a look at this and add it as a future feature.

manijak avatar Mar 01 '17 10:03 manijak