Closed vikasacharya16 closed 4 years ago
When i tried to auto play the images by below code
const carousel = args.object.getViewById("myCarousel"); setInterval(() => { if (carousel.selectedIndex == carousel.items.length - 1) carousel.selectedIndex = 0; else ++carousel.selectedIndex; }, 3000); }
only the images will auto play. but not indicators at the bottom.
but when i manually scroll it, the indicators will change and no problem.
this is my xml
<pager:Pager items="{{ image_array }}" row="0" id="myCarousel" loaded="carouselLoaded" unloaded="carouselUnloaded" spacing="0%" peaking="0%" showIndicator="true" backgroundColor="lightsteelblue"> <pager:Pager.itemTemplate> <GridLayout> <Image src="{{ image }}" stretch="aspectFill" /> </GridLayout> </pager:Pager.itemTemplate> </pager:Pager>
When i tried to auto play the images by below code
only the images will auto play. but not indicators at the bottom.
but when i manually scroll it, the indicators will change and no problem.
this is my xml