Android? M? Control: Appbarlayout

Source: Internet
Author: User

Appbarlayout

Appbarlayout, like its name, takes the components of the container class all as AppBar. is a ViewGroup container component that inherits the Linerlayout implementation, which is designed for material design app Bar and supports gesture swipe operations.

The default appbarlayout is vertically oriented, and its role is to appbarlayout the contents of the package as AppBar.

is that Put toolbar and tablayout in the appbarlayout, let them as a whole as a appbar.

Common code layouts:

<android.support.design.widget.appbarlayout

Android:id= "@+id/appbar"

Android:layout_width= "Match_parent"

android:layout_height= "Wrap_content" >

<android.support.v7.widget.toolbar

Android:id= "@+id/toolbar"

Android:layout_width= "Match_parent"

android:layout_height= "? Attr/actionbarsize"

Android:background= "? Attr/colorprimary"

android:minheight= "Attr/actionbarsize" ></android.support.v7.widget.Toolbar>

<android.support.design.widget.tablayout

Android:id= "@+id/tabs"

Android:layout_width= "Match_parent"

android:layout_height= "Wrap_content"

app:layout_scrollflags= "Scroll"

App:tabindicatorcolor= "@android: Color/holo_red_dark"

App:tabselectedtextcolor= "@android: Color/holo_red_dark"

App:tabtextcolor= "@android: Color/black"/>

</android.support.design.widget.AppBarLayout>

Note: Appbarlayout must be a parent layout container for toolbar

Appbarlayout is supported for gesture swipe, but works with Coordinatorlayout .

Coordinatorlayout



From for notes (Wiz)

Android? M? Control: Appbarlayout

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.