- Layout의 종류인 TableLayout의 아주 간단한 예제이다.
- 실전에서 TableLayout을 활용해 화면 배치를 해보자.
-xml 소스
- 실전에서 TableLayout을 활용해 화면 배치를 해보자.
-xml 소스
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TableRow // 테이블로우로 텍스트뷰를 묶는다.
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="국어 " />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="영어 " />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="수학" />
</TableRow>
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="88 " />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="92 " />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="76" />
</TableRow>
</TableLayout>
- 실행화면
- 실행화면
'JAVA > Android' 카테고리의 다른 글
안드로이드 Intent putExtra, getIntent 예제 따라하기 (2) | 2012.01.06 |
---|---|
안드로이드 Tabhost 예제 따라하기 (0) | 2012.01.05 |
안드로이드 Intent 예제 따라하기 (0) | 2012.01.04 |
안드로이드 Calulator(계산기) 예제 따라하기 (0) | 2012.01.03 |
안드로이드 CustomTab 예제 따라하기 (3) | 2012.01.03 |