Android滑动页面导航效果: PagerSlidingTabStrip
2014-08-06 16:20
429 查看
把github上的PagerSlidingTabStrip稍作修改:
tab的文字颜色选中变色(原版文字不变色),类似微信导航
栗子:http://download.csdn.net/detail/onlyonecoder/7722021
PagerSlidingTabStrip 自定义属性列表:
修改后加了一个属性 selectedTabTextColor
如果不设置 默认和 滑动指示器颜色(pstsIndicatorColor)一致
下图效果的代码:
tab的文字颜色选中变色(原版文字不变色),类似微信导航
栗子:http://download.csdn.net/detail/onlyonecoder/7722021
PagerSlidingTabStrip 自定义属性列表:
pstsIndicatorColorColor of the sliding indicator
pstsUnderlineColorColor of the full-width line on the bottom of the view
pstsDividerColorColor of the dividers between tabs
pstsIndicatorHeightHeight of the sliding indicator
pstsUnderlineHeightHeight of the full-width line on the bottom of the view
pstsDividerPaddingTop and bottom padding of the dividers
pstsTabPaddingLeftRightLeft and right padding of each tab
pstsScrollOffsetScroll offset of the selected tab
pstsTabBackgroundBackground drawable of each tab, should be a StateListDrawable
pstsShouldExpandIf set to true, each tab is given the same weight, default false
pstsTextAllCapsIf true, all tab titles will be upper case, default true
修改后加了一个属性 selectedTabTextColor
如果不设置 默认和 滑动指示器颜色(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>
相关文章推荐
- Android滑动页面导航效果: PagerSlidingTabStrip
- android之TabLayout实现PagerSlidingTabStrip,ViewpagerIndicator之类的效果滑动页面导航效果(类似网易新闻)
- Android PagerSlidingTabStrip可实现滑动导航栏效果
- 【Android界面实现】使用PagerSlidingTabStrip实现滑动标签同步的ViewPager效果
- 使用PagerSlidingTabStrip实现滑动标签同步的ViewPager效果
- Android使用TabLayou+fragment+viewpager实现滑动切换页面效果
- Android ViewPager和Fragment实现顶部导航界面滑动效果、标签下的tab位置
- Android PagerSlidingTabStrip实现顶部栏目点击或滑动切换
- Android典型界面设计(8) ——ViewPager+PagerSlidingTabStrip实现双导航
- 谷歌官方Android最新滑动选项导航卡SlidingTabLayout和SlidingTabStrip
- 谷歌官方Android最新滑动选项导航卡SlidingTabLayout和SlidingTabStrip
- 仿多页面滑动切换时背景指示图(如TAB文字下边的白条等)的动画实现原理,例PagerSlidingTabStrip
- (四)使用PagerSlidingTabStrip和ViewPager实现可左右滑动和点击效果功能
- Android典型界面设计(8) ——ViewPager+PagerSlidingTabStrip实现双导航
- 【Android 界面效果27】利用ViewPager、Fragment、PagerTabStrip实现多页面滑动效果
- Android典型界面设计(8) ——ViewPager+PagerSlidingTabStrip实现双导航
- PagerSlidingTabStrip制作Android带标签的多界面滑动切换
- Android中使用PagerSlidingTabStrip实现导航标题的示例
- Android源码解析-仿今日头条PagerSlidingTabStrip滑动页面导航效果
- Android TabLayout、ViewPager实现顶部和底部Tab导航 点击滑动切换Tab页面