我有一个要滚动的tableview,因为数据显示不完整。

 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:stretchColumns="0,1,2,3,4"
            android:id="@+id/maintable" >
</TableLayout>

这是我的表格布局,如果我将其包装在<ScrollView> </Scrollview>中,则在我打开 Activity 时应用程序将崩溃。怎么做?

最佳答案

您确实应该放入尝试使应用程序崩溃的代码以及崩溃的原因。您的原始帖子中没有有值(value)的信息。

嗯...您尝试过像这样简单的事情吗?我在几个地方使用的示例.xml:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TableLayout android:id="@+id/score_table"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <TableRow android:id="@+id/header"/>
    </TableLayout>
</ScrollView>

对我来说绝对不错。显然,如果您没有使用TableRow,则不必包括它。

10-07 19:08
查看更多