2024/5/12
<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 android:layout_width="match_parent"
5 android:layout_height="match_parent"
6 android:orientation="vertical"
7 android:weightSum="10"
8 android:padding="16dp">
9
10 <!-- 页头标题 -->
11 <TextView
12 android:id="@+id/tv_dashboard_title"
13 android:layout_width="wrap_content"
14 android:layout_height="0dp"
15 android:layout_weight="2"
16 android:gravity="center_vertical"
17 android:text="仪表盘"
18 android:textSize="24sp"
19 android:textStyle="bold" />
20
21 <!-- 分割线 -->
22 <View
23 android:layout_width="match_parent"
24 android:layout_height="1dp"
25 android:background="@color/divider_color"/>
26
27 <!-- 操作按钮区域 -->
28 <LinearLayout
29 android:layout_width="match_parent"
30 android:layout_height="0dp"
31 android:layout_weight="3"
32 android:orientation="horizontal"
33 android:weightSum="3"
34 android:paddingTop="8dp">
35
36 <!-- 示例按钮1 -->
37 <Button
38 android:id="@+id/btn_dashboard_action_1"
39 android:layout_width="0dp"
40 android:layout_height="wrap_content"
41 android:layout_weight="1"
42 android:text="操作1"/>
43
44 <!-- 示例按钮2 -->
45 <Button
46 android:id="@+id/btn_dashboard_action_2"
47 android:layout_width="0dp"
48 android:layout_height="wrap_content"
49 android:layout_weight="1"
50 android:text="操作2"/>
51
52 <!-- 示例按钮3 -->
53 <Button
54 android:id="@+id/btn_dashboard_action_3"
55 android:layout_width="0dp"
56 android:layout_height="wrap_content"
57 android:layout_weight="1"
58 android:text="操作3"/>
59 </LinearLayout>
60
61 <!-- 数据展示区域,这里以CardView为例 -->
62 <androidx.cardview.widget.CardView
63 android:id="@+id/cv_dashboard_data"
64 android:layout_width="match_parent"
65 android:layout_height="0dp"
66 android:layout_weight="5"
67 android:layout_marginTop="8dp"
68 app:cardCornerRadius="8dp"
69 app:cardElevation="4dp">
70
71 <TextView
72 android:layout_width="wrap_content"
73 android:layout_height="wrap_content"
74 android:layout_gravity="center"
75 android:text="数据展示区域"
76 android:textSize="18sp"
77 android:padding="16dp"/>
78
79 </androidx.cardview.widget.CardView>
80
81</LinearLayout>