2016-04-15 87 views
0

當我更新viewpager和viewpagerindicator對象時,viewpager升級以及新項目展示,但viewpagerindicator留在它的老位置ViewPagerIndicator不更新位置

featuredIndicators.setVisibility(View.VISIBLE); 
this.featuredPager.setAdapter(new ProductImagePagerAdapter(getChildFragmentManager(), option.getAllImageUrl())); 
featuredIndicators.setViewPager(this.featuredPager); 

請幫

+0

u能顯示更多的代碼 –

+0

您使用的指標任何圖書館? –

+0

請看解決方案..我試了一下,它的工作 – XylemRaj

回答

0

問題解決。 只需添加featuredIndicators.setCurrentItem(0); 設置適配器,即在第二行前

更新代碼:

featuredIndicators.setVisibility(View.VISIBLE); 
featuredIndicators.setCurrentItem(0); 
this.featuredPager.setAdapter(new 
ProductImagePagerAdapter(getChildFragmentManager(),option.getAllImageUrl())); 
featuredIndicators.setViewPager(this.featuredPager);