gpt4 book ai didi

android - Horizo​​ntalScrollView 中的 TableLayout

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:00:49 27 4
gpt4 key购买 nike

我正在使用以下代码创建一个可水平滚动的 TableLayout:

      <?xml version="1.0" encoding="utf-8"?>
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="200dp"
android:scrollbars="none">

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/maintable2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stretchColumns="*"
android:background ="#dddddd"
android:scrollbars="none" >
</TableLayout>
</HorizontalScrollView>

我需要 TableLayout 中的列至少填满屏幕(即,如果只有一列,则该列的边框应覆盖整个屏幕,如果有两列,两列的边框应填满屏幕等)。

我该怎么做?

最佳答案

我遇到了同样的问题。我通过将 android:fillViewport="true" 添加到 Horizo​​ntalScrollView 来解决这个问题。

关于android - Horizo​​ntalScrollView 中的 TableLayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6036867/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com