Android studio_第二次作业

一.九宫格

 

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 3     android:layout_width="match_parent"
 4     android:layout_height="match_parent">
 5 
 6     <Button
 7         android:id="@+id/button1"
 8         android:layout_width="80dp"
 9         android:layout_height="80dp"
10         android:layout_centerInParent="true"
11         android:background="#00FFFF"
12         android:text="1" />
13 
14     <Button
15         android:id="@+id/button2"
16         android:layout_width="80dp"
17         android:layout_height="80dp"
18         android:layout_centerVertical="true"
19         android:layout_toLeftOf="@+id/button1"
20         android:background="#C4C400"
21         android:text="2" />
22 
23     <Button
24         android:id="@+id/button3"
25         android:layout_width="80dp"
26         android:layout_height="80dp"
27         android:background="#7373B9"
28         android:layout_above="@+id/button2"
29         android:layout_toLeftOf="@+id/button4"
30         android:text="3"/>
31 
32     <Button
33         android:id="@+id/button4"
34         android:layout_width="80dp"
35         android:layout_height="80dp"
36         android:layout_above="@+id/button1"
37         android:layout_centerHorizontal="true"
38         android:background="#FF0000"
39         android:text="4" />
40     <Button
41         android:id="@+id/button5"
42         android:layout_width="80dp"
43         android:layout_height="80dp"
44         android:layout_centerVertical="true"
45         android:layout_toRightOf="@+id/button1"
46         android:background="#809797"
47         android:text="5" />
48     <Button
49         android:id="@+id/button6"
50         android:layout_width="80dp"
51         android:layout_height="80dp"
52         android:layout_above="@+id/button5"
53         android:layout_toRightOf="@+id/button4"
54         android:background="#FFFFFF"
55         android:text="6" />
56     <Button
57         android:id="@+id/button7"
58         android:layout_width="80dp"
59         android:layout_height="80dp"
60         android:layout_below="@+id/button1"
61         android:layout_centerHorizontal="true"
62         android:background="#D37E63"
63         android:text="7" />
64     <Button
65         android:id="@+id/button8"
66         android:layout_width="80dp"
67         android:layout_height="80dp"
68         android:layout_below="@+id/button2"
69         android:layout_toLeftOf="@+id/button7"
70         android:background="#F08597"
71         android:text="8" />
72     <Button
73         android:layout_width="80dp"
74         android:layout_height="80dp"
75         android:id="@+id/buttont9"
76         android:layout_below="@+id/button5"
77         android:layout_toRightOf="@+id/button7"
78         android:background="#097AD5"
79         android:text="9"/>
80     <TextView
81         android:layout_width="wrap_content"
82         android:layout_height="wrap_content"
83         android:text="九宫格色板"
84         android:textColor="#19287C"
85         android:textSize="30sp"
86         android:layout_above="@+id/button4"
87         android:layout_centerHorizontal="true"/>
88 
89 
90 </RelativeLayout>

二.登录界面制作

 

posted @ 2020-09-23 19:43  熊大To  阅读(131)  评论(0编辑  收藏  举报