private Bannerban;
private RecyclerViewrec;
Listintegers;
Liststrings;
Listdata=new ArrayList<>();
integers=new ArrayList<>();
strings=new ArrayList<>();
integers.add(R.drawable.ic_action_false);
integers.add(R.drawable.ic_action_true);
integers.add(R.drawable.ic_action_false);
// 设置标题
strings.add("标题1");
strings.add("标题2");
strings.add("标题3");
ban.setDelayTime(1000);
ban.setImages(integers);
ban.setBannerTitles(strings);
ban.setBannerStyle(BannerConfig.CIRCLE_INDICATOR_TITLE);
//主要是这句话
ban.setImageLoader(new ImageLoader() {
@Override
public void displayImage(Context context, Object path, ImageView imageView) {
imageView.setImageResource((Integer) path);
}
});
// 开始轮播
ban.start();