一、组件介绍 App产品中信息列表头部都会有自动轮转的广告图片,使用ViewPager可以实现但编码比较麻烦,我们可以采用使用LoopView开源控件来完成, LoopView是一个强大的轮转大图控件,并且提供了许多配置方法足以满足你的应用需求二、环境配置 如果您的项目使用 ...
App产品中信息列表头部都会有自动轮转的广告图片,使用ViewPager可以实现但编码比较麻烦,我们可以采用使用LoopView开源控件来完成, LoopView是一个强大的轮转大图控件,并且提供了许多配置方法足以满足你的应用需求
如果您的项目使用 Gradle 构建, 只需要在您的build.gradle文件添加下面一行到 dependencies :
compile 'com.kevin:loopview:1.0.4'
1、在layout.
在Layout文件添加<com.kevin.loopview.AdLoopView>代码如下:
<RelativeLayout ="http://schemas.android.com/apk/res/android" ="http://schemas.android.com/tools" ="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <com.kevin.loopview.AdLoopView android:id="@+id/adloop_act_adloopview" android:layout_width="match_parent" android:layout_height="192dp" kevin:loop_interval="5000" kevin:loop_dotMargin="5dp" kevin:loop_autoLoop="true" kevin:loop_dotSelector="@drawable/ad_dots_selector" kevin:loop_layout="@layout/ad_loopview_layout"> </com.kevin.loopview.AdLoopView></RelativeLayout>
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:Android 开源组件
关键词:Android
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。