博客
关于我
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>

你可能感兴趣的文章
mysqldump: Got error: 1044: Access denied for user ‘xx’@’xx’ to database ‘xx’ when using LOCK TABLES
查看>>
Mysqldump参数大全(参数来源于mysql5.5.19源码)
查看>>
mysqldump备份时忽略某些表
查看>>
mysqldump实现数据备份及灾难恢复
查看>>
mysqldump数据库备份无法进行操作只能查询 --single-transaction
查看>>
mysqldump的一些用法
查看>>
mysqli
查看>>
MySQLIntegrityConstraintViolationException异常处理
查看>>
mysqlreport分析工具详解
查看>>
MySQLSyntaxErrorException: Unknown error 1146和SQLSyntaxErrorException: Unknown error 1146
查看>>
Mysql_Postgresql中_geometry数据操作_st_astext_GeomFromEWKT函数_在java中转换geometry的16进制数据---PostgreSQL工作笔记007
查看>>
mysql_real_connect 参数注意
查看>>
mysql_secure_installation初始化数据库报Access denied
查看>>
MySQL_西安11月销售昨日未上架的产品_20161212
查看>>
Mysql——深入浅出InnoDB底层原理
查看>>
MySQL“被动”性能优化汇总
查看>>
MySQL、HBase 和 Elasticsearch:特点与区别详解
查看>>
MySQL、Redis高频面试题汇总
查看>>
MYSQL、SQL Server、Oracle数据库排序空值null问题及其解决办法
查看>>
mysql一个字段为空时使用另一个字段排序
查看>>