博客
关于我
TabPagerIndicator使用
阅读量:486 次
发布时间:2019-03-07

本文共 1433 字,大约阅读时间需要 4 分钟。

敲打1 注意/在清单文件中配置activity/theme=

android:theme="@style/Theme.PageIndicatorDefaults">

//吐舌头2   (adpter中添加getPageTitle)

//1.给viewPager设置数据适配器        MyPagerAdapter myPagerAdapter = new MyPagerAdapter();        pager.setAdapter(myPagerAdapter);        //2.指示器和viewPager进行绑定        indicator.setViewPager(pager);

3 重点(修改选中文字的颜色,背景)生气values/style/tabPageIndicator

@android:color/transparent 为加背景,,不能用@null

<item name="vpiTabPageIndicatorStyle">@style/Widget.TabPageIndicator</item>//这里

</style>

<style name="Widget"> </style> <style name="Widget.TabPageIndicator" parent="Widget"> <item name="android:gravity">center</item>
<item name="android:background">@drawable/vpi__tab_indicator</item>//背景
<item name="android:paddingLeft">22dip</item> <item name="android:paddingRight">22dip</item> <item name="android:paddingTop">12dp</item> <item name="android:paddingBottom">12dp</item> <item name="android:textAppearance">@style/TextAppearance.TabPageIndicator</item> <item name="android:textSize">12sp</item> <item name="android:maxLines">1</item> </style> <style name="TextAppearance.TabPageIndicator" parent="Widget"> <item name="android:textStyle">bold</item>
<item name="android:textColor">@color/vpi__dark_theme</item>//文字颜色
</style> <style name="Widget.IconPageIndicator" parent="Widget"> <item name="android:layout_marginLeft">6dp</item> <item name="android:layout_marginRight">6dp</item> </style></resources>

你可能感兴趣的文章
Mysql面试题精选
查看>>
MySQL面试题集锦
查看>>
mysql面试题,存储引擎InnoDB和MyISAM
查看>>
mysql面试题:为什么MySQL单表不能超过2000W条数据?
查看>>
mysql面试题:创建索引时会不会锁表?
查看>>
mysql面试题:高度为3的B+树可以存放多少数据?
查看>>
mysql颠覆实战笔记(八)--mysql的自定义异常处理怎么破
查看>>
mysql驱动、durid、mybatis之间的关系
查看>>
mysql驱动支持中文_mysql 驱动包-Go语言中文社区
查看>>
MySQL高可用之——keepalived+互为主从
查看>>
MySQL高可用切换_(5.9)mysql高可用系列——正常主从切换测试
查看>>
MySQL高可用解决方案
查看>>
MySQL高可用解决方案详解
查看>>
MYSQL高可用集群MHA架构
查看>>
MySQL高可用集群架构MHA企业级实战
查看>>
MySQL高级-MySQL存储引擎
查看>>
MySQL高级-MySQL并发参数调整
查看>>
MySQL高级-MySQL应用优化
查看>>
MySQL高级-MySQL查询缓存优化
查看>>
MySQL高级-MySQL锁
查看>>