如何在android中滚动tableview

Mar*_*ark 5 android scrollview tableview

我有一个我要滚动的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>
Run Code Online (Sandbox Code Playgroud)

这是我的tablelayout,如果我将它包装在<ScrollView> </Scrollview>Application崩溃中,如果我打开活动.怎么做?

Cod*_*key 12

你应该把你尝试过的代码丢失在你的应用程序中,以及崩溃的原因.您的原始帖子中没有有价值的信息.

呃......你尝试过这么简单的事吗?我使用几个地方的示例.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>
Run Code Online (Sandbox Code Playgroud)

对我来说绝对没问题.显然,如果你没有使用它,你不必包括TableRow.