我的代码: 布局/ sf4.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:id="@+id/layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip"
android:fillViewport="true"
android:scrollbarStyle="outsideInset"
android:scrollbars="horizontal|vertical" >
<HorizontalScrollView
android:id="@+id/horizontalView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:scrollbars="horizontal|vertical" >
<TableLayout
android:id="@+id/tlGridTable1"
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#b4b4b4" >
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="GRADE/LEVEL YEAR" />
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="SECTION" />
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="NAME OF ADVISER" />
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="ATTENDANCE"
android:layout_span="6" />
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="DROPPED OUT"
android:layout_span="9" />
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="TRANSFERRED OUT"
android:layout_span="9" />
<TextView
android:background="@drawable/cell_header"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="TRANSFERRED IN"
android:layout_span="9" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#b4b4b4" >
<TextView
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text=""
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Daily Average"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="Percentage for the Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(A)Culmulative as of Previous Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(B)For the Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(A+B)Cumulative as of End of the Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(A)Culmulative as of Previous Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(B)For the Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(A+B)Cumulative as of End of the Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(A)Culmulative as of Previous Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(B)For the Month"
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="(A+B)Cumulative as of End of the Month"
android:layout_span="3" />
</TableRow>
<TableRow
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#b4b4b4" >
<TextView
android:padding="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text=""
android:layout_span="3" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="M" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="F" />
<TextView
android:background="@drawable/cell_shape"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="T" />
</TableRow>
</TableLayout>
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#b4b4b4"/>
<stroke android:width="1dp" android:color="#000"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="#fff"/>
<stroke android:width="1dp" android:color="#000"/>
</shape>
先谢谢你们。如果你不理解我的问题,请问我。