尽管文字包装为inside the cell
,但无法让我的TableLayout适合屏幕when the text cell is large
。Android桌面布局格式问题
这是我的TableLayout。一个简单的两行,两列表格。左列单元格是multiline
。如果其中一个单元格的文本足够大,可以分成两行,则该列将被拉伸以填充整个屏幕,并且右列将被推出屏幕。
为什么?我如何强制整个桌子留在屏幕内? 欢迎任何提示。
我TableLayout如下:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/myTableLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TableRow>
<TextView
android:text="Account 4 with a very large name to see if it breaks on two or more lines"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<TextView
android:text="$400.00"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
</TableRow>
<TableRow>
<TextView
android:text="Account 5"
android:singleLine="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
<TextView
android:text="$400.00"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
</TextView>
</TableRow>
</TableLayout>
的代码显示布局是基本的:
public class AccountBrowserTest
extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.setContentView(R.layout.accountbrowser_test);
}
}
以及究竟这意味着什么?你怎么知道这是解决方案? – Paul 2012-02-08 14:11:28