CircleIndicator
介绍:
一个轻量级的viewpager indicator(相对于JakeWharton的ViewPagerIndicator来说)
运行效果:
使用说明:
xml:
<pers.medusa.circleindicator.widget.CircleIndicator
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:id="@+id/indicator"
CircleIndicator:ci_background="@android:color/white"
CircleIndicator:ci_selected_background="0xffe6454a"
CircleIndicator:ci_mode="outside"
CircleIndicator:ci_gravity="center"
CircleIndicator:ci_radius="10dp"
CircleIndicator:ci_margin="5dp"
/>
java:
circleIndicator.setViewPager(viewPager);
注意这个方法需要在ViewPager.setAdapter()之后调用。
属性:
-
app: ci_radius :indicator's radius
-
app: ci_margin :margin between two indicators
-
app: ci_background:indicator's background
-
app: ci_selected_background:selected indicator's background
-
app: ci_gravity:indicator's layout gravity,support left,center and right.
-
app: ci_mode:indicator's change mode when viewpager scrolled
已下载
0