小编use*_*461的帖子

以编程方式滚动到 TableLayout 中的一行

我有一个包含在 Scrollview 中的 TableLayout。TableLayout 在运行时以编程方式填充。该表包含航班到达信息。已填充 TableLayout 之一,我希望能够向下滚动到当前时间段。

如果我知道要滚动到表中第 40 行(共 100 行),我该怎么做?

这是布局的 XML。提前致谢。

<LinearLayout
        android1:id="@+id/LinearLayout20"
        android1:layout_width="fill_parent"
        android1:layout_weight="1"
        android:orientation="vertical"
        android1:background="#000000" android:layout_height="10000dp" android:measureWithLargestChild="true">

    <ScrollView
            android1:id="@+id/scrollView1"
            android1:layout_width="match_parent"
            android1:layout_height="wrap_content">

        <TableLayout
                android1:id="@+id/arrivalstable"
                android1:layout_width="wrap_content"
                android1:layout_height="wrap_content">
        </TableLayout>
    </ScrollView>

</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android scroll tablelayout

2
推荐指数
1
解决办法
3413
查看次数

标签 统计

android ×1

scroll ×1

tablelayout ×1