Android 안드로이드 XML Layout 레이아웃의 종류
1. <LinearLayout>
예제코드
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" android:orientation="vertical">
</LinearLayout>
2. <FrameLayout>
왼쪽 상단에 자식 뷰들을 배치하여 절대 좌표를 가지고 레이아웃을 구성한다.
3. <TableLayout>
예제코드
<TableLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:stretchColumns="0,1,2,3,4,5">
<TableRow>
<TextView android:text="1QT" android:gravity="center" android:background="#ffffff" android:padding="3dip" /> <TextView android:text="2QT" android:gravity="center" android:background="#dfdfdf" android:padding="3dip" /> <TextView android:text="3QT" android:gravity="center" android:background="#ffffff" android:padding="3dip" /> <TextView android:text="4QT" android:gravity="center" android:background="#dfdfdf" android:padding="3dip" /> <TextView android:text="OT1" android:gravity="center" android:background="#ffffff" android:padding="3dip" /> <TextView android:text="OT2" android:background="#dfdfdf" android:gravity="center" android:padding="3dip" /> </TableRow>
</TableLayout>
속성
android:stretchColumns="0,1,2,3,4,5" - 표를 이루는 칼럼들을 표의 크기에 맞게 크기를 늘려준다.
android:text="1QT" - 표 안의 text 를 나타내며 @string/stringVal 의 형식으로 values/strings.xml 에서 가져올 수 있다.
android:gravity="center" - 표 안의 내용을 가운데로 정렬한다.
작성 중... 추후 수정 예정