<?xml version="1.0" encoding="utf-8"?>    <androidx.drawerlayout.widget.DrawerLayout        xmlns:android="http://schemas.android.com/apk/res/android"        android:layout_width="match_parent"        android:layout_height="match_parent"><!--第一个view为显示的控件-->        <LinearLayout            android:layout_width="150dp"            android:layout_height="match_parent"            >            <ImageView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:src="@mipmap/ic_launcher_round"                android:layout_gravity="center"/>        </LinearLayout>    <!--第二个view为滑动显示的控件-->    <!--android:layout_gravity="left" 设置为left就是左滑动,right就是右滑过-->    <LinearLayout            android:background="@color/colorPrimaryDark"            android:layout_width="150dp"            android:layout_height="match_parent"            android:layout_gravity="left"            >            <TextView                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:text="left menu"/>        </LinearLayout>    <!--android:layout_gravity="left" 不设置为主体内容-->    <LinearLayout        android:orientation="vertical"        android:layout_width="match_parent"        android:layout_height="match_parent"        >        <Button            android:layout_width="match_parent"            android:layout_height="wrap_content"            android:text="123"/>        <TextView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:text="123"/>    </LinearLayout></androidx.drawerlayout.widget.DrawerLayout>

更多相关文章

  1. Android学习之自定义控件之图片带文字的View
  2. Android注解式绑定控件,没你想象的那么难
  3. 自定义实现类似android主界面的滑屏换屏控件
  4. Android界面设计基础:控件焦点4个步骤
  5. android 开发零起步学习笔记(九):android 控制控件的位置和大小及L
  6. 一起写一个Android图片轮播控件
  7. Android中自定义控件的步骤
  8. Android 动态增加控件

随机推荐

  1. 【Android】在Android上使用OrmLite数据
  2. Android的Window类 [转]
  3. android系统体系结构
  4. Android之父深入解析Android
  5. Android(安卓)创建与解析XML(一)—— 概述
  6. android获取设备唯一标识完美解决方案
  7. android介绍以及学习方法
  8. android 深入需要学习的
  9. 详细的北京安卓培训班课程内容介绍
  10. Android(安卓)am 指令的使用