Skip to main content

Posts

Showing posts with the label Featured

Android New Design Features with new Android Design Support Library

NavigationView as DrawerLayout’s drawer content view with a layout such as:
<android.support.v4.widget.DrawerLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"android:fitsSystemWindows="true"><!-- your content layout --><android.support.design.widget.NavigationViewandroid:layout_width="wrap_content"android:layout_height="match_parent"android:layout_gravity="start"app:headerLayout="@layout/drawer_header"app:menu="@menu/drawer"/></android.support.v4.widget.DrawerLayout>

You’ll note two attributes for NavigationView: app:headerLayout controls the (optional) layout used for the header.app:menu is the menu resource inflated for the navigation items (which can also be updated at runtime). NavigationViewtakes care of the scrim protection …