安卓5.0材质风格的标签 [英] Android 5.0 Material-styled tabs

查看:201
本文介绍了安卓5.0材质风格的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

难道是Android 5.0框架已材质风格的标签?我知道在开发preVIEW,他们仍然全息风格。我在想,如果5.0已更新,材料,样式的选项卡;我目前使用 PagerSlidingTabStrip 我的标签,但一直没有更新,材料的设计呢。

Does the Android 5.0 framework have Material-styled tabs? I know in the dev preview, they were still Holo-styled. I was wondering if 5.0 has been updated with material-style tabs; I currently use PagerSlidingTabStrip for my tabs, but that has not been updated with Material design yet.

更具体地说,它支持库包括材料标签的实现?在4.x的运行Play商店有这些标签,但我不知道这是一个自定义实现由谷歌或没有。

More specifically, does the support library include an implementation of material tabs? The Play Store running on 4.x has those tabs, but I'm not sure if that's a custom implementation by Google or not.

推荐答案

这是现在Android的设计支持库提供的:

编译com.android.support:design:23.1.0

克里斯·巴内斯例如:

https://github.com/chrisbanes/cheesesquare

Android开发者博客:

http://android-developers.blogspot.com/2015/05/android-design-support-library.html

Android的文档:

<一个href="http://developer.android.com/reference/android/support/design/widget/TabLayout.html?utm_campaign=io15&utm_source=dac&utm_medium=blog" rel="nofollow">http://developer.android.com/reference/android/support/design/widget/TabLayout.html?utm_campaign=io15&utm_source=dac&utm_medium=blog

支持库:

https://developer.android.com/tool​​s/support-库/ features.html#设计

看看谷歌最新版本的播放(下图)。

Look at the latest version of Google Play(down below).

他们使用的是 SlidingTabsColors (不SlidingTabsBasic),但颜色。你需要看一下这两个文件:<一href="https://developer.android.com/samples/SlidingTabsColors/src/com.example.android.common/view/SlidingTabLayout.html"相对=nofollow> SlidingTabLayout.java 和<一href="https://developer.android.com/samples/SlidingTabsColors/src/com.example.android.common/view/SlidingTabStrip.html"相对=nofollow> SlidingTabStrip.java 和简单地改变颜色,以配合您的动作条/工具栏中的颜色。

They are using the SlidingTabsColors(not SlidingTabsBasic) but with colors. You need to look at those two files: SlidingTabLayout.java and SlidingTabStrip.java and simply change the color to match your ActionBar/TooBar color.

此外,你会发现,当你刷卡左/右,在分页标题字体颜色将变成白,未选择的标题是一个灰色的色彩。

Also, you will notice when you swipe left/right, the Tab title text color will become "white" and the unselected titles are an "gray" color.

例如(如何更改指示器颜色):

For example(how to change the indicator color):

class SlidingTabStrip extends LinearLayout {
    // change the strip color
    private static final int DEFAULT_SELECTED_INDICATOR_COLOR = 0xFF33B5E5;
   ...
}

请参见这里的例子: https://developer.android.com/samples/ SlidingTabsColors / index.html的

请阅读这些还有:

Android的 - 谷歌喜欢玩标签

<一个href="http://stackoverflow.com/questions/24473213/action-bar-navigation-modes-are-de$p$pcated-in-android-l">Action酒吧导航模式pcated Android中大号德$ P $

这篇关于安卓5.0材质风格的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆