Android 5.0特性--DrawerLayout

1,实现效果

  • 1.SlidingMenu第三开源的侧滑控件

  • 2.SlidingDrawer抽屉控件。

2,实现逻辑

  •     android:layout_gravity="start" 添加 在左边,end添加在右边

<?xml version="1.0" encoding="utf-8"?>

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"

    xmlns:app="http://schemas.android.com/apk/res-auto"

    xmlns:tools="http://schemas.android.com/tools"

    android:layout_width="match_parent"

    android:layout_height="match_parent"

    tools:context="com.xiaoshuai.www.actionbar.MainActivity">

    <FrameLayout

        android:id="@+id/content"

        android:layout_width="match_parent"

        android:layout_height="match_parent"

        android:background="#fff000">

    </FrameLayout>

    <FrameLayout

        android:id="@+id/menu"

        android:background="#000"

        android:layout_width="200dp"

        android:layout_gravity="start"

        android:layout_height="match_parent"/>

</android.support.v4.widget.DrawerLayout>



猜你喜欢

转载自blog.csdn.net/Cricket_7/article/details/88917917