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> </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