圈页面指标 - 如何改变填充颜色变化 [英] Circle page indicator - how to change fill color changing

查看:95
本文介绍了圈页面指标 - 如何改变填充颜色变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 ViewPageIndicator ,特别是 CirclePageIndictor 在我的Andr​​oid应用程序。该要求是填充颜色的将直接移动到该指标的下一个圈,没有像这样的画面中的情况(圆圈缓慢移动,并保持在同时呼叫中间)

I'm using ViewPageIndicator, specifically CirclePageIndictor in my Android application. The requirement is that the fillColor will move straight to the next circle in the indicator, without the situation like this one in the picture (the circle moves slowly and stays in the middle while paging)

我怎样才能做到这一点?

How can i do this ?

推荐答案

您可以试试这个在您的xml:

You can try this on your xml:

<com.viewpagerindicator.CirclePageIndicator
        android:id="@+id/indicator"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:padding="10dip"
        app:radius="12dp"
        app:fillColor="@color/header_bg_color"
        app:pageColor="#ffffff"
        app:strokeColor="@color/header_bg_color"/>

和不要忘记添加的xmlns:程序=htt​​p://schemas.android.com/apk/res-auto的布局。 例如

and don't forget to add xmlns:app="http://schemas.android.com/apk/res-auto" on your layout. E.g

 <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        />

    <com.viewpagerindicator.CirclePageIndicator
            android:id="@+id/indicator"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:padding="10dip"
            app:radius="12dp"
            app:fillColor="@color/header_bg_color"
            app:pageColor="#ffffff"
            app:strokeColor="@color/header_bg_color"/>

</LinearLayout>

这篇关于圈页面指标 - 如何改变填充颜色变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆