查看器指示器的默认颜色为白色。
在github的relex视图寻呼机指示器中,
它不包括如何改变指示器的颜色。
有可能吗?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<me.relex.circleindicator.CircleIndicator
android:id="@+id/pagerIndicator"
app:ci_width="10dp"
app:ci_height="10dp"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_gravity="bottom"
android:layout_marginBottom="8dp" />
</LinearLayout>
发布于 2017-04-14 00:01:25
<me.relex.circleindicator.CircleIndicator
android:id="@+id/pagerIndicator"
app:ci_width="10dp"
app:ci_height="10dp"
app:ci_drawable="@drawable/circleindicator_round"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_gravity="bottom"
android:layout_marginBottom="8dp" />
我不关心你做什么填充或边距
但是创建一个可绘制的XML文件并添加以下代码
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorAccent"/>
<corners android:radius="10dp"/>
</shape>
你想叫什么就叫什么,但要用
`app:ci_drawable="@drawable/circleindicator_round"`
对我很管用
发布于 2015-12-24 15:58:24
来自github页面的:在属性下
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<me.relex.circleindicator.CircleIndicator
android:id="@+id/pagerIndicator"
app:ci_width="10dp"
app:ci_height="10dp"
app:ci_drawable="your drawable defining the color"
android:layout_width="match_parent"
android:layout_height="36dp"
android:layout_gravity="bottom"
android:layout_marginBottom="8dp" />
</LinearLayout>
https://stackoverflow.com/questions/34449140
复制相似问题