We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果图片不满四张会报出IllegalStateException的异常错误,需要手动重写instantiateItem()和destroyItem()方法,其中主要操作在前者,后者将父类destroyItem()方法注释掉就行了,建议作者在LoopPagerAdapter中修改instantiateItem()方法如下: @OverRide public Object instantiateItem(ViewGroup container, int position) { int realPosition = position%getRealCount(); View itemView = findViewByPosition(container,realPosition); ViewParent vp=itemView.getParent(); if(vp!=null){ ViewGroup vg=(ViewGroup)vp; vp.removeView(itenmView); } container.addView(itemView); return itemView; }
个人建议,仅供参考!
The text was updated successfully, but these errors were encountered:
追加一下,如果这样了,就不需要在destroyItem()方法中removeView了
Sorry, something went wrong.
No branches or pull requests
如果图片不满四张会报出IllegalStateException的异常错误,需要手动重写instantiateItem()和destroyItem()方法,其中主要操作在前者,后者将父类destroyItem()方法注释掉就行了,建议作者在LoopPagerAdapter中修改instantiateItem()方法如下:
@OverRide
public Object instantiateItem(ViewGroup container, int position) {
int realPosition = position%getRealCount();
View itemView = findViewByPosition(container,realPosition);
ViewParent vp=itemView.getParent();
if(vp!=null){
ViewGroup vg=(ViewGroup)vp;
vp.removeView(itenmView);
}
container.addView(itemView);
return itemView;
}
个人建议,仅供参考!
The text was updated successfully, but these errors were encountered: