1
我创建的表像利用Html
代码的下面,如何在Android的创造TableLayout类似HTML表格
现在,如何做到这样的在Android中使用TableLayout
。
Note:
如果需要我会发布我的html
代码。
我创建的表像利用Html
代码的下面,如何在Android的创造TableLayout类似HTML表格
现在,如何做到这样的在Android中使用TableLayout
。
Note:
如果需要我会发布我的html
代码。
使用GridLayout
<?xml version="1.0" encoding="utf-8"?>
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:rowCount="3"
android:columnCount="3"
android:layout_height="wrap_content">
<Button
android:text="1"
android:background="#00f"
android:layout_height="wrap_content"
android:layout_gravity="fill"
android:layout_rowSpan="2"
android:layout_width="wrap_content"/>
<Button
android:text="2"
android:layout_columnSpan="2"
android:layout_gravity="fill"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<Button
android:text="3"
android:layout_gravity="fill"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<Button
android:text="4"
android:layout_rowSpan="2"
android:layout_gravity="fill"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
<Button
android:text="5"
android:layout_gravity="fill"
android:layout_columnSpan="2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</GridLayout>
输出