Material tabs on Android 5.0 toolbar

Source: Internet
Author: User

How can I achieve the tab effect in android5.0 like the Play store? (scroll hide, appropriate spacing), I tried Slidingtabs and some other Lib libraries, they are basically extended.

With regard to some details, before the ANDROID5 version, api20, I often use Actionbar.setnavigationmode (actionbar.navigation_mode_tabs); , but in android5.0, the whole actionbar was replaced by toolbar.
.
How can I use Material Design to make the same effect as Google Paly store? How does Android 5 keep tabs hidden while scrolling?

Processing methods

Their layout is basically like this, not up to the same program as the Play Store


<linearlayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "android:orientation=" vertical "android:layout_width=" match_parent "Android:layout_heig        ht= "Match_parent" > <android.support.v7.widget.toolbar xmlns:app= "Http://schemas.android.com/apk/res-auto" Android:id= "@+id/my_awesome_toolbar" android:layout_height= "wrap_content" android:layout_width= "Match_paren T "android:minheight="? Attr/actionbarsize "android:background="? Attr/colorprimary "App:theme=" @style/ ThemeOverlay.AppCompat.ActionBar "> <linearlayout android:layout_width=" Match_parent "a                ndroid:layout_height= "wrap_content" android:orientation= "vertical" > <textview android:text= "@string/hello_world" android:layout_width= "Wrap_content" android:layout_height = "Wrap_content" android:layout_margintop= "16DP" style= "@style/textappearance.appcompat.widget.actionbar.title"/> <widget .                Slidingtablayout android:id= "@+id/sliding_tabs" android:layout_width= "Match_parent" android:layout_height= "Wrap_content"/> </LinearLayout> &LT;/ANDROID.SUPPORT.V7.WIDGET.TOOLBAR&G     T <linearlayout android:orientation= "vertical" android:layout_width= "fill_parent" Android:layout_hei ght= "Fill_parent" android:paddingleft= "@dimen/activity_horizontal_margin" android:paddingright= "@dimen/activ Ity_horizontal_margin "android:paddingtop=" @dimen/activity_vertical_margin "android:paddingbottom=" @dimen/ac Tivity_vertical_margin "> <textview android:text=" @string/hello_world "Android:layout_w            Idth= "Wrap_content" android:layout_height= "wrap_content"/> <android.support.v4.view.viewpager Android: id= "@+id/viewpager" android:layout_width= "match_parent" android:layout_height= "Wrap_content"/> </LinearLayout></LinearLayout>


Original address: http://www.itmmd.com/201411/209.html
This article by Meng Meng's IT person to organize the release, reprint must indicate the source.

Material tabs on Android 5.0 toolbar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.