IT/Android

Widget - Layout

바바옄 2015. 6. 17. 11:20
반응형

activity_main.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">
 
    <!--
        gravity : 내용물을 정렬
    -->
    <TextView
        android:text="아래의 버튼을 클릭하세요"
        android:textSize="30dp"
        android:gravity="center"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        />
    <!--
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        이 두개는 제일 상단에서 한번만 사용하면 된다.
     -->
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button
            android:text="버튼 1"
            android:textSize="30dp"
            android:layout_marginLeft="10dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="버튼 2"
            android:textSize="30dp"
            android:layout_marginLeft="10dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="버튼 3"
            android:textSize="30dp"
            android:layout_marginLeft="10dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>
 
    <TextView
        android:text="잘하셨어요"
        android:textSize="30dp"
        android:gravity="center"
        android:layout_marginTop="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
 
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
        <Button
            android:text="버튼 1"
            android:textSize="30dp"
            android:layout_marginLeft="10dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
        <Button
            android:text="버튼 2"
            android:textSize="30dp"
            android:layout_marginLeft="10dp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
 
        <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <Button
                android:text="버튼 3"
                android:textSize="30dp"
                android:layout_marginLeft="10dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <Button
                android:text="버튼 4"
                android:textSize="30dp"
                android:layout_marginLeft="10dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <Button
                android:text="버튼 5"
                android:textSize="30dp"
                android:layout_marginLeft="10dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
            <Button
                android:text="버튼 6"
                android:textSize="30dp"
                android:layout_marginLeft="10dp"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </LinearLayout>
 
    </LinearLayout>
 
</LinearLayout>
 
cs

 

 

반응형

'IT > Android' 카테고리의 다른 글

Container - TabHost  (0) 2015.06.18
Widget - WebView  (0) 2015.06.17
Widget - ProgressBar  (0) 2015.06.17
Widget - ImageView  (0) 2015.06.16
Widget - Switch  (0) 2015.06.16