安卓第一次作业

1:安装环境,截图编程界面,截图运行界面

2 九宫格

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     xmlns:app="http://schemas.android.com/apk/res-auto"
 4     xmlns:tools="http://schemas.android.com/tools"
 5     android:id="@+id/rl_1"
 6     android:layout_width="match_parent"
 7     android:layout_height="match_parent"
 8     android:padding="1dp">
 9 
10     <View
11         android:id="@+id/v_1"
12         android:layout_width="100dp"
13         android:layout_height="100dp"
14         android:background="#F5DB6E3A"
15         android:layout_centerInParent="true"/>
16     <View
17         android:id="@+id/v_2"
18         android:layout_width="100dp"
19         android:layout_height="100dp"
20         android:background="#27E298"
21         android:layout_centerInParent="true"
22         android:layout_toLeftOf="@id/v_1"/>
23     <View
24         android:id="@+id/v_3"
25         android:layout_width="100dp"
26         android:layout_height="100dp"
27         android:background="#C33FE0"
28         android:layout_centerInParent="true"
29         android:layout_toRightOf="@id/v_1"/>
30     <View
31         android:id="@+id/v_4"
32         android:layout_width="100dp"
33         android:layout_height="100dp"
34         android:background="#456FD8"
35         android:layout_centerInParent="true"
36         android:layout_above="@id/v_1"/>
37     <View
38         android:id="@+id/v_5"
39         android:layout_width="100dp"
40         android:layout_height="100dp"
41         android:background="#C94E5C"
42         android:layout_centerInParent="true"
43         android:layout_above="@id/v_1"
44         android:layout_toLeftOf="@id/v_4"/>
45     <View
46         android:id="@+id/v_6"
47         android:layout_width="100dp"
48         android:layout_height="100dp"
49         android:background="#DCE2470A"
50         android:layout_centerInParent="true"
51         android:layout_above="@id/v_1"
52         android:layout_toRightOf="@id/v_4"/>
53     <View
54         android:id="@+id/v_7"
55         android:layout_width="100dp"
56         android:layout_height="100dp"
57         android:background="#9EC459"
58         android:layout_centerInParent="true"
59         android:layout_below="@id/v_1"/>
60     <View
61         android:id="@+id/v_8"
62         android:layout_width="100dp"
63         android:layout_height="100dp"
64         android:background="#5445DD"
65         android:layout_centerInParent="true"
66         android:layout_below="@id/v_1"
67         android:layout_toLeftOf="@id/v_7"/>
68     <View
69         android:id="@+id/v_9"
70         android:layout_width="100dp"
71         android:layout_height="100dp"
72         android:background="#E437CEBD"
73         android:layout_centerInParent="true"
74         android:layout_below="@id/v_1"
75         android:layout_toRightOf="@id/v_7"/>
76 </RelativeLayout>

 

 

 3 QQ截图

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent"
 5     android:layout_margin="10dp"
 6     android:orientation="vertical">
 7  
 8  
 9     <LinearLayout
10         android:layout_width="match_parent"
11         android:layout_weight="1"
12         android:background="#DD5F09"
13         android:layout_height="0dp" />
14     <LinearLayout
15         android:layout_width="match_parent"
16         android:layout_weight="4"
17         android:background="#B44C4C"
18         android:orientation="horizontal"
19         android:layout_height="0dp">
20         <View
21             android:layout_weight="1"
22             android:layout_height="match_parent"
23             android:background="#489E68"
24             android:layout_width="0dp" />
25         <View
26             android:layout_weight="3"
27             android:layout_height="match_parent"
28         android:background="#AF52BE"
29             android:layout_width="0dp"/>
30         <View
31             android:layout_weight="1"
32             android:layout_height="match_parent"
33             android:background="#D5BA59"
34             android:layout_width="0dp"/>
35     </LinearLayout>>
36     <LinearLayout
37         android:layout_width="match_parent"
38         android:layout_weight="1"
39         android:background="#C4426E"
40         android:layout_height="0dp" />
41 </LinearLayout>

 

 

 4 登录页面

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:id="@+id/rl_1"
 4     android:layout_width="match_parent"
 5     android:layout_height="match_parent"
 6     >
 7 
 8     <ImageView
 9         android:id="@+id/image_1"
10         android:layout_width="150dp"
11         android:layout_height="150dp"
12         android:background="@drawable/yy"
13         android:layout_centerHorizontal="true"
14         android:layout_marginTop="100dp"/>
15     <EditText
16         android:id="@+id/zhanghao"
17         android:layout_width="match_parent"
18         android:layout_height="50dp"
19         android:layout_margin="20dp"
20         android:paddingLeft="20dp"
21         android:hint="请输入账号"
22         android:background="@drawable/log"
23         android:layout_below="@id/image_1"
24         android:layout_marginTop="40dp"/>
25     <EditText
26         android:id="@+id/mima"
27         android:layout_width="match_parent"
28         android:layout_height="50dp"
29         android:layout_margin="20dp"
30         android:paddingLeft="20dp"
31         android:hint="请输入密码"
32         android:background="@drawable/log"
33         android:layout_below="@id/zhanghao"
34         android:layout_marginTop="40dp"/>
35     <Button
36         android:layout_width="150dp"
37         android:layout_height="60dp"
38         android:layout_below="@id/mima"
39         android:layout_centerHorizontal="true"
40         android:text="登录"
41         android:textColor="#ffffff"
42         android:textSize="25sp"/>
43 </RelativeLayout>

 

posted @ 2021-08-29 12:58  MaLD  阅读(50)  评论(0编辑  收藏  举报