Android滑动页面导航效果: PagerSlidingTabStrip
来源:互联网 发布:知客是什么意思 编辑:程序博客网 时间:2024/05/17 00:33
把github上的PagerSlidingTabStrip稍作修改:
tab的文字颜色选中变色(原版文字不变色),类似微信导航
栗子:http://download.csdn.net/detail/onlyonecoder/7722021
PagerSlidingTabStrip 自定义属性列表:
pstsIndicatorColor
Color of the sliding indicatorpstsUnderlineColor
Color of the full-width line on the bottom of the viewpstsDividerColor
Color of the dividers between tabspstsIndicatorHeight
Height of the sliding indicatorpstsUnderlineHeight
Height of the full-width line on the bottom of the viewpstsDividerPadding
Top and bottom padding of the dividerspstsTabPaddingLeftRight
Left and right padding of each tabpstsScrollOffset
Scroll offset of the selected tabpstsTabBackground
Background drawable of each tab, should be a StateListDrawablepstsShouldExpand
If set to true, each tab is given the same weight, default falsepstsTextAllCaps
If true, all tab titles will be upper case, default true
如果不设置 默认和 滑动指示器颜色(pstsIndicatorColor)一致
下图效果的代码:
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- xmlns:app="http://schemas.android.com/apk/res/org.lmw.demo.slidingtab">
- <org.lmw.demo.slidingtab.widget.PagerSlidingTabStrip
- android:id="@+id/tabs"
- android:layout_width="match_parent"
- android:layout_height="40dp"
- app:pstsShouldExpand="true"
- app:pstsUnderlineHeight="2dp"
- app:pstsIndicatorHeight="2dp"
- app:pstsIndicatorColor="@android:color/holo_blue_light"
- app:selectedTabTextColor="@android:color/holo_blue_light"
- app:pstsDividerColor="@android:color/transparent"
- app:pstsTabBackground="@drawable/background_tab"
- android:background="@android:color/white"
- />
- <android.support.v4.view.ViewPager
- android:id="@+id/pager"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_below="@+id/tabs" />
- </RelativeLayout>
0 0
- Android滑动页面导航效果: PagerSlidingTabStrip
- Android滑动页面导航效果: PagerSlidingTabStrip
- Android滑动页面导航效果: PagerSlidingTabStrip
- Android源码解析-仿今日头条PagerSlidingTabStrip滑动页面导航效果
- Android PagerSlidingTabStrip可实现滑动导航栏效果
- android之TabLayout实现PagerSlidingTabStrip,ViewpagerIndicator之类的效果滑动页面导航效果(类似网易新闻)
- android 滑动导航效果FragmentTabViewPager
- 滑动导航栏(PagerSlidingTabStrip)实践
- PagerSlidingTabStrip实现网易新闻导航栏效果
- Android 利用ViewPager实现底部圆点导航左右滑动效果以及Fragment页面切换
- 【Android界面实现】使用PagerSlidingTabStrip实现滑动标签同步的ViewPager效果
- Android实现导航菜单左右滑动效果
- Android实现导航菜单左右滑动效果
- Android实现导航菜单左右滑动效果
- Android实现导航菜单左右滑动效果
- Android实现导航菜单左右滑动效果
- Android实现导航菜单左右滑动效果
- Android实现导航菜单左右滑动效果
- arm汇编按键控制led灯
- 从程序的执行过程的角度去编写IRQ中断框架代码
- 闭包
- EmguCV+Kinect2.0获取BodyIndex图
- 解决php支付宝接口支付时会跳到一个确定按钮页
- Android滑动页面导航效果: PagerSlidingTabStrip
- ZOJ 1610 Count the Colors 线段树/暴力模拟
- ubuntu系统 ln 命令使用说明,创建链接
- uva 11524 Values whose Sum is 0
- 并查集 杭电1232畅通工程
- 剑指offer面试题java版系列 题1 Singleton模式
- BAPC2014 K&&HUNNU11591:Key to Knowledge(中途相遇法)
- mysql中使用case when 做where条件筛选表记录
- Java集合类: Set、List、Map、Queue使用场景梳理