在只有2列的TableRow中设置3个文本视图-Android
我试图在在只有2列的TableRow中设置3个文本视图-Android,android,xml,textview,tablelayout,tablerow,Android,Xml,Textview,Tablelayout,Tablerow,我试图在表格布局中创建表格行,如下所示: _____________________________________ | ___________________ ____________ | | |TEXTVIEW 1 | |TEXTVIEW 2 | | | | | |___________| |
表格布局中创建表格行
,如下所示:
_____________________________________
| ___________________ ____________ |
| |TEXTVIEW 1 | |TEXTVIEW 2 | |
| | | |___________| |
| | | ___________ |
| | | |TEXTVIEW 3 | |
| |___________________| |___________| |
|_____________________________________|
希望这是有道理的。我正在尝试将3个文本视图
放入一个表格行
。第一列将包含一个多行宽TextView
,而第二列将包含两个单行短TextView
,它们将堆叠在一起
这可能吗?如果没有,我将如何着手实现这一点?下面是我开始编写的xml代码
<TableLayout
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_height="fill_parent"
android:layout_width="fill_parent" >
<TableRow
android:id="@+id/row1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/question"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textStyle="bold"
android:textSize="8sp" />
<TextView
android:id="@+id/timer"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textStyle="bold"
android:textSize="8sp" />
<TextView
android:id="@+id/points"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textStyle="bold"
android:textSize="8sp" />
</TableRow>
</TableLayout>
多行文字
正文
正文
所以第2列/第1行需要是一个TableLayout,其中TableLayout包含2行?太棒了!:)谢谢
<TableLayout>
<TableRow>
Multiline Text
<TableLayout>
<TableRow>
Text
</TableRow>
<TableRow>
Text
</TableRow>
</TableLayout>
</TableRow>
</TableLayout>