1.导入依赖
compile 'com.jude:rollviewpager:1.4.5'
2.布局文件中插入控件
com.jude.rollviewpager.RollPagerView
3.代码实现
roll.setPlayDelay( 1000 );
roll.setAdapter( new StaticPagerAdapter() {
private int[] imgs = { R.mipmap.bb,R.mipmap.cc};
@Override
public View getView(ViewGroup container, int position) {
ImageView imageView = new ImageView( XiangActivity.this );
imageView.setImageResource( imgs[position] );
return imageView;
}
@Override
public int getCount() {
return imgs.length;
}
} );
网友评论