Skip to content
New issue

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

数据源size为1时怎么处理左右不滑动 #32

Open
slimvan opened this issue Jan 5, 2018 · 1 comment
Open

数据源size为1时怎么处理左右不滑动 #32

slimvan opened this issue Jan 5, 2018 · 1 comment

Comments

@slimvan
Copy link

slimvan commented Jan 5, 2018

数据源为空的时候需要在Banner的位置显示一张默认图,不需要滑动。
直接设置setViewUrls(null)不行,尝试过传入一个集合,里面add一条数据,发现同一张图在banner里可以无限左右滑动..发现在LoopPagerAdapter的getCount方法,return了一个INT_MAX,不知道是不是这里的原因?请问这个需求要怎么处理?

@wuyinlei
Copy link

wuyinlei commented Sep 3, 2018

isCanScroll ? Integer.MAX_VALUE : 1 你可以在getCount()的时候 判断是否需要滑动,如果不需要滑动那就返回1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants