You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.
在用UltraViewPager实现banner放在vlayout中时会出现banner不能够显示的问题,具体的代码片段为
final UltraViewPager viewPager = new UltraViewPager(context); final PagerAdapter pagerAdapter = new PagerAdapter(this, viewPool); viewPager.setAdapter(pagerAdapter); .... viewPager.setAdapter(null); ... viewPager.setAdapter(pagerAdapter);
这样就会出现pagerAdapter没有被设置到viewPager,出现这种用法的情况就是在参考VLayoutActivity.java中#onCreate的if (BANNER_LAYOUT)部分,将其中的ViewPager替换为UltraViewPager,并且将onBindViewHolder中的viewPager.setAdapter(new PagerAdapter(this, viewPool));改为viewPager.setAdapter(mAdapter);mAdapter为全局的。
这个问题通过每次都new一个adapter可以解决,但这样做不是很好,故提这个issue。感谢您阅读此issue!
The text was updated successfully, but these errors were encountered: