Android的 - 谷歌播放喜欢的标签 [英] Android - Google Play like tabs

查看:148
本文介绍了Android的 - 谷歌播放喜欢的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谷歌刚刚实施了新的面貌他们的标签在谷歌播放。

Google has just implemented a new look to their tabs in Google Play.

我知道这可以ViewPagerIndicator做,但我不喜欢用我的应用程序的另一个库,并通过另一个MB撞击应用程序的大小左右。

I know this can be done with ViewPagerIndicator, yet I wouldn't like to use another library in my application and bump the app's size by another MB or so.

我目前使用的android.support.v4.view.PagerTabStrip(如在老谷歌播放),我想知道,如果新的外观也可以使用Android的支持库来实现。

I am currently using the android.support.v4.view.PagerTabStrip (like in the old Google Play), and I'm wondering if the new look can also be implemented using the android support library.

在此先感谢。

推荐答案

设计支持库包括 TabLayout 控件,它可以让你实现一个谷歌播放烈标签:

Design Support Library (current method).

The Design Support Library includes the TabLayout widget which allows you to implement a Google Play-lie tabs:

<android.support.design.widget.TabLayout
    android:id="@+id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

,然后初始化它:

and then initializing it:

TabLayout tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);

有关完整的示例,请参见 Cheesesquare应用

For a full example see the Cheesesquare app

这是一个随时可以使用的库,可以发现Github上

This is a ready-to-use library that you can find on Github.

屏幕截图

这篇关于Android的 - 谷歌播放喜欢的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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