Drawerlayout

使用

DrawerLayout类在Support Library里,有android-support-v4.jar这个包即可

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <android.support.v4.widget.DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <FrameLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />


        <ListView
            android:id="@+id/left_drawer"
            android:layout_width="240dp"
            android:layout_height="match_parent"
            android:layout_gravity="left"
            android:background="#111"
            android:choiceMode="singleChoice"
            android:divider="@android:color/transparent"
            android:dividerHeight="0dp" />
    </android.support.v4.widget.DrawerLayout>

</RelativeLayout>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,035评论 25 709
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,654评论 2 45
  • 在之前的开发经历中经常需要导入一些如v4、v7、v13等Android官方的支持包,遇到这些情况时都是网上搜索一下...
    都有米阅读 16,072评论 34 141
  • “处暑先生!处暑先生!你给我站住!”我气鼓鼓地追着前面那个扛着大西瓜提着蚂蚱笼子的黄绿色的人。 处暑先生不小心撞上...
    dimplee阅读 3,038评论 3 1
  • 小程序的正式发布让整个业内又鸡血了一把,一个个小程序在微信群里被传播,以及各种小程序的微信交流群、培训课程都一夜之...
    白崎阅读 12,567评论 59 104