#table layout
1. table 형태의 layout을 말한다.
2. tablerow : 행을 의미하며 tablelayout의 하위구성요소이다.
3. stretchColums : tablerow에 포함되어 있는 view의 폭에 맞추어 열을 자동확장 하는 것을 말한다.
1
2
3
4
5
|
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="1,2">
|
cs |
Line5 stretchColumns의 value가 1,2여서 index[1]번째와 index[2]번째의 비율이 같아짐.
0,1,2였으면 셋이 같은비율
아무것도 없으면 걍 구석에 짜져있음
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
|
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onButton1Ball"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onButton1Ball"
android:text="Button" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onButton1Ball"
android:text="Button" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onButton1Strike"
android:text="Button" />
</TableRow>
|
cs |
'ANDROID > 되새김질' 카테고리의 다른 글
리스너 이벤트 메서드 (0) | 2019.09.16 |
---|---|
안드로이드 복습 - 3 RelativeLayout (0) | 2019.09.05 |
안드로이드 복습 - 2 (0) | 2019.09.05 |
안드로이드 크기 단위 dp, sp, pt, px, mm, in (0) | 2019.09.05 |
안드로이드 복습 1 - 기본구조 (0) | 2019.09.04 |