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

图片数量小于3时魅族模式失效 #98

Open
Cedar-byte opened this issue Apr 12, 2019 · 4 comments
Open

图片数量小于3时魅族模式失效 #98

Cedar-byte opened this issue Apr 12, 2019 · 4 comments

Comments

@Cedar-byte
Copy link

图片只有一张或两张时,设置的魅族模式无效,改哪里的代码能解决这个问题?

@zzy904494436
Copy link

同样的问题!正在看如何解决

@huapeng222
Copy link

把数组塞入重复数据吧

数组长度为1,就放三个一样的元素,{1,1,1}
数组长度为2,就把1和2重复塞入,变成{1,2,1,2}
临时这样改吧,我也遇到这样的问题,找了半天也没意识到时图片数量过少的问题
https://github.com/pinguo-zhouwei/MZBannerView/issues/109

@zhangnin
Copy link

zhangnin commented Jun 8, 2020

把数组塞入重复数据吧

数组长度为1,就放三个一样的元素,{1,1,1}
数组长度为2,就把1和2重复塞入,变成{1,2,1,2}
临时这样改吧,我也遇到这样的问题,找了半天也没意识到时图片数量过少的问题
https://github.com/pinguo-zhouwei/MZBannerView/issues/109

请问,现在有解决方案了吗?

@zhangnin
Copy link

zhangnin commented Jun 8, 2020

我处理了,通过自定义 MZBannerView ,把源码里面的 setPages 方法中的【以下代码屏蔽】就可以了

// if (datas.size() < 3) {
// this.mIsOpenMZEffect = false;
// MarginLayoutParams layoutParams = (MarginLayoutParams)this.mViewPager.getLayoutParams();
// layoutParams.setMargins(0, 0, 0, 0);
// this.mViewPager.setLayoutParams(layoutParams);
// this.setClipChildren(true);
// this.mViewPager.setClipChildren(true);
// }

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

4 participants