我使用davemorrissey 的 SubsamplingScaleImageView制作了一个 ViewPager
滑动 ViewPager 时,下一张幻灯片在图像加载前几秒钟显示为空白。
有没有人遇到过同样类型的问题?任何可能修复的指针?
viewPager = (ViewPager) findViewById(R.id.pager);
magePagerAdapter adapter = new ImagePagerAdapter();
viewPager.setAdapter(adapter);
ArrayList<String> imageFull = new ArrayList<String>();
for(int i=0;i<10;i++){
String image = "mnt/sdcard/imageDemo"+i+".jpg";
imageFull.add(image);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
Context context = ImageGallery.this;
SubsamplingScaleImageView fullImage = new SubsamplingScaleImageView(ImageGallery.this);
fullImage.setImage(ImageSource.uri(imageFull.get(position)));
return fullImage;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
((ViewPager) container).removeView((SubsamplingScaleImageView) object);
}