xbanner使用

compile 'com.xhb:xbanner:1.2.2'


imgesUrl = new ArrayList<>();
for (int i=0;i<5;i++){
    Log.d("bbb",list.get(i).getThumbnail_pic_s());
    imgesUrl.add(list.get(i).getThumbnail_pic_s());
}
ban.setData(imgesUrl,null);
 
  
 
  
ban.setmAdapter(this);
 
  
 
  
@Override
public void loadBanner(XBanner banner, View view, int position) {
    ImageLoader.getInstance().displayImage(imgesUrl.get(position), (ImageView) view, Utils.getDefaultOption());
}
 
  
<com.stx.xhb.xbanner.XBanner
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/banner2"
    android:layout_width="match_parent"
    android:layout_height="180dp"
    app:pointsPosition="CENTER"
    app:AutoPlayTime="3000"
    app:pointsContainerBackground="#44aaaaaa"
  />

你可能感兴趣的:(xbanner使用)