<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawerlayout" android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:id="@+id/fragment_layout" android:layout_width="match_parent" android:layout_height="match_parent" > <RelativeLayout android:id="@+id/title_bar" android:layout_width="match_parent" android:layout_height="48dp" android:background="#63B8FF" > <ImageView android:id="@+id/leftmenu" android:layout_width="48dp" android:layout_height="48dp" android:padding="12dp" android:onClick="leftmenu" android:src="@mipmap/ic_launcher" /> <TextView android:layout_width="wrap_content" android:layout_height="48dp" android:layout_centerInParent="true" android:gravity="center" android:text="侧拉菜单+夜间模式" /> <ImageView android:id="@+id/rightmenu" android:layout_width="48dp" android:layout_height="48dp" android:layout_alignParentRight="true" android:padding="12dp" android:src="@mipmap/ic_launcher" /> </RelativeLayout> <LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/title_bar" android:orientation="vertical" /> </RelativeLayout> <RelativeLayout android:id="@+id/left" android:layout_width="200dp" android:layout_height="match_parent" android:layout_gravity="left" android:background="@android:color/white" > <Switch android:id="@+id/left_but" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="夜间模式" android:background="#00ff00" android:textOff="关" android:textOn="开" /> </RelativeLayout> </android.support.v4.widget.DrawerLayout>
xml布局侧拉菜单
最新推荐文章于 2023-04-07 21:56:10 发布