Android Kotlin基于ViewPage2和ViewBinding的轻量级BannerView,功能全面,易定制扩展
-
//Add it in your root build.gradle at the end of repositories: allprojects { repositories { ... maven { url 'https://jitpack.io' } } } //Add it in your app build.gradle dependencies { implementation 'com.github.zhzc0x:banner-android:$version' }
-
布局文件中声明(更多属性说明详见 #自定义属性说明)
<com.zhzc0x.banner.BannerView android:id="@+id/bannerView1" android:layout_width="match_parent" android:layout_height="0dp" app:autoplay="true" app:loopPlay="true" app:displayTextBackground="#4D000000" app:displayTextColor="@color/white" app:displayTextGravity="left" app:displayTextSize="16sp" app:displayTextStyle="bold" app:indicatorGravity="bottom|right" app:isNumberIndicator="false" app:layout_constraintBottom_toTopOf="@+id/bannerView2" app:layout_constraintTop_toTopOf="parent" />
-
代码调用(Kotlin)