首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >定制LineIndicator of ViewPagerIndicator

定制LineIndicator of ViewPagerIndicator
EN

Stack Overflow用户
提问于 2014-03-04 17:37:20
回答 1查看 3.5K关注 0票数 1

我是ViewPagerIndicator的新手。我正在使用LineIndicator和我的ViewPager。默认的外观是微小的蓝线,无论你定位在哪里。

但是,如果我想要改变颜色、宽度和高度,怎么做呢?

更新

如果您看一下所示的样本电话,中间的那个在底部有红线。该应用程序的标题是“线条/样式(通过布局)”。这正是我正在努力实现的目标。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-04 17:56:32

只需在LinePageIndicator布局文件中设置.xml样式即可。

例:

代码语言:javascript
复制
<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.LinePageIndicator
        android:id="@+id/indicator"
        android:padding="5dip"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"
        app:strokeWidth="4dp"
        app:lineWidth="30dp"
        app:unselectedColor="#FF888888"
        app:selectedColor="#FF880000"
        />

</LinearLayout>
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22179035

复制
相关文章

相似问题

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