Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

如何轮播布局呀,求添加一下使用方法啊? #5

Open
ShouyanLi opened this issue May 24, 2018 · 3 comments
Open

如何轮播布局呀,求添加一下使用方法啊? #5

ShouyanLi opened this issue May 24, 2018 · 3 comments

Comments

@ShouyanLi
Copy link

轮播任意布局是要在代码里动态添加布局吗?轮播布局不会用呀,求写个用法呀

@donkingliang
Copy link
Owner

mBanner.setPages(new CustomBanner.ViewCreator() {
@OverRide
public View createView(Context context, int position) {
// 在这里创建和返回你要轮播的布局。
return view;
}

        @Override
        public void updateUI(Context context, View view, int position, String entity) {
           //在这里更新你的布局内容。这里的view就是你的布局。
        }
    }, list)

轮播布局和轮播图片是一样的,只要把ImageView改成你要轮播的布局就可以了。

@ShouyanLi
Copy link
Author

好的,
view = LayoutInflater.from(context).inflate(R.layout.banner_item, null);
我自己尝试了一下,可以的,谢谢啦!

@ShouyanLi
Copy link
Author

坐等大神你把滑动的时候有一个小卡顿还有滑动的时候禁止自动轮播这两个问题优化一下!!!

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

No branches or pull requests

2 participants