首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Viewpager Relex圆形指示器颜色

Viewpager Relex圆形指示器颜色
EN

Stack Overflow用户
提问于 2015-12-24 15:44:44
回答 2查看 10.3K关注 0票数 13

查看器指示器的默认颜色为白色。

在github的relex视图寻呼机指示器中,

它不包括如何改变指示器的颜色。

有可能吗?

代码语言:javascript
运行
复制
  <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>
EN

回答 2

Stack Overflow用户

发布于 2017-04-14 00:01:25

代码语言:javascript
运行
复制
    <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文件并添加以下代码

代码语言:javascript
运行
复制
<?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>

你想叫什么就叫什么,但要用

代码语言:javascript
运行
复制
`app:ci_drawable="@drawable/circleindicator_round"`

对我很管用

票数 22
EN

Stack Overflow用户

发布于 2015-12-24 15:58:24

来自github页面的:在属性

代码语言:javascript
运行
复制
<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>
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34449140

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档