直播平台搭建源码,XBanner设置只显示轮播图
直播平台搭建源码,XBanner设置只显示轮播图
setData()和loadImage()方法同时设置才能生效
XBanner bannerView;
private List<BannerItem> bannerItems = new ArrayList<>();
bannerItems.clear();
bannerItems.addAll(bannerItem);
bannerView.setData(R.layout.xbanner_custom_layout, bannerItems, titlelists);
bannerView.loadImage(new XBanner.XBannerAdapter() {
@Override
public void loadBanner(XBanner banner, Object model, View view, int position) {
ImageView img = (ImageView) view.findViewById(R.id.img);
GlideImgManager.loadImage(mContext, bannerItems.get(position).getPicture(), img);
}
});
bannerView.setOnItemClickListener(new XBanner.OnItemClickListener() {
@Override
public void onItemClick(XBanner banner, Object model, View view, int position) {
}
});
以上就是 直播平台搭建源码,XBanner设置只显示轮播图,更多内容欢迎关注之后的文章