android实现banner轮播图无限轮播效果

这篇文章主要为大家详细介绍了android实现banner轮播图无限轮播效果,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

本文实例为大家分享了banner轮播图无限轮播效果的具体代码,供大家参考,具体内容如下

效果展示

第一步(权限配置)

 

第二步(添加依赖)

 compile 'com.squareup.okio:okio:1.5.0' compile 'com.squareup.okhttp3:okhttp:3.2.0' compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' compile 'com.google.code.gson:gson:2.8.2' compile 'com.youth.banner:banner:1.4.9' //compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' compile 'com.github.bumptech.glide:glide:3.7.0' 

第三步(加布局)

   

第四步:(创建GlideImageLoader 图片加载类)

 public class GlideImageLoader extends ImageLoader { @Override public void displayImage(Context context, Object path, ImageView imageView) { Glide.with(context).load(path).into(imageView); } } 

第五步:(在onCreate中加)

 mbanner= (Banner) findViewById(R.id.mybanner); GetDate(mpath); 
 private void GetDate(String url){ OkHttp3Utils.getInstance().doGet(url, new GsonObjectCallback() { @Override public void onUi(HomeBean homeBean) { for(int i=0; i

最后提醒:网络数据接口您自己供应。

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持html中文网。

以上就是android实现banner轮播图无限轮播效果的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 移动