다음은 나의 테이블 코드입니다. 내 화면은 http://imgur.com/dFP298o처럼 보이지만이 모양은 http://imgur.com/YuYJiJx처럼 보이게하고 싶습니다. 각 행과 테이블 레이아웃 주위에 테두리를 추가하려면 어떻게합니까? 테이블 행 주위와 테이블 레이아웃 주위에 테두리를 생성하기 위해TableLayout 주위에 테두리를 추가하는 방법은 무엇입니까?
<TableLayout
android:id="@+id/table2"
android:layout_width="fill_parent"
android:layout_below="@+id/test_button_text23"
android:layout_marginLeft="45dp"
android:layout_marginBottom="25dp"
android:layout_marginRight="45dp"
android:layout_height="fill_parent"
android:stretchColumns="*" >
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:gravity="left"
android:text="Quantity"
android:textStyle="bold" />
<TextView
android:gravity="center"
android:textStyle="bold"
android:text="Item" />
</TableRow>
</TableLayout>
<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/localTime"
android:textColor="#000000"
android:gravity="left" />
<TextView
android:id="@+id/apprentTemp"
android:textColor="#000000"
android:gravity="center" />
</TableRow>
View row = getLayoutInflater().inflate(R.layout.rows, null);
((TextView) row.findViewById(R.id.localTime)).setText(item.getString("Item"));
((TextView) row.findViewById(R.id.apprentTemp)).setText(item.getString("Quantity"));
이 다른 답변을 살펴보십시오. http://stackoverflow.com/a/7379990/2324810 – Hadriel
내 코드를 편집하는 것이 너무 혼란 스럽습니다. – user2589245