你的位置:首页 > 软件开发 > 操作系统 > Android中使用开源框架PagerSlidingTabStrip实现导航标题

Android中使用开源框架PagerSlidingTabStrip实现导航标题

发布时间:2017-01-16 00:00:24
此开源框架官网地址:https://github.com/astuetz/PagerSlidingTabStrip可以理解为配合ViewPager使用的交互式页面指示器控件。话不多说,先上效果图:为了演示其中的pstsIndicatorHeight与pstsUnderlineHe ...

Android中使用开源框架PagerSlidingTabStrip实现导航标题

 此开源框架官网地址:https://github.com/astuetz/PagerSlidingTabStrip

可以理解为配合ViewPager使用的交互式页面指示器控件。

话不多说,先上效果图:

Android中使用开源框架PagerSlidingTabStrip实现导航标题

为了演示其中的pstsIndicatorHeight与pstsUnderlineHeight 的区别,进行了不同的设置已区分效果(做了去除actionbar处理)。大家可以很直观的看出相比之前单独使用ViewPager以及ViewPager与Fragement嵌套,本次演示PagerSlidingTabStrip的使用,为页面导航提供了相对更加绚丽的切换效果,下面我们就介绍下PagerSlidingTabStrip的使用。

前期相关博文推荐:

Android中Fragment和ViewPager那点事儿

Android中使用ViewPager实现屏幕页面切换和页面轮播效果

一、基本属性介绍

·       apstsIndicatorColor //Color of the sliding indicator  滑动条的颜色

·        pstsUnderlineColor //Color of the full-width line onthe bottom of the view  滑动条所在的那个全宽线的颜色

·        pstsDividerColor //Color of the dividers betweentabs   每个标签的分割线的颜色

·        pstsIndicatorHeight //Height of the sliding indicator      滑动条的高度

·        pstsUnderlineHeight //Height of the full-width line onthe bottom of the view    滑动条所在的那个全宽线的高度

·        pstsDividerPadding //Top and bottom padding of thedividers   分割线底部和顶部的填充宽度

·        pstsTabPaddingLeftRight //Left and right padding of eachtab   每个标签左右填充宽度

·        pstsScrollOffset //Scroll offset of the selectedtab

·        pstsTabBackground //Background drawable of each tab,should be a StateListDrawable  每个标签的背景,应该是一个StateListDrawable  

·        pstsShouldExpand //If set to true, each tab isgiven the same weight, default false   如果设置为true,每个标签是相同的控件,均匀平分整个屏幕,默认是false

·        pstsTextAllCaps //If true, all tab titles will beupper case, default true   如果为true,所有标签都是大写字母,默认为true

所有的属性都有他们自己的getter和setter方法来随时改变他们

Android中使用开源框架PagerSlidingTabStrip实现导航标题

二、本次演示的代码结构

Android中使用开源框架PagerSlidingTabStrip实现导航标题

三、设置去除ActionBar


原标题:Android中使用开源框架PagerSlidingTabStrip实现导航标题

关键词:Android

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录