android - 带有 GridView 的 ScrollView 不滚动到底部
问题描述
<ScrollView
android:id="@+id/verticalScrollView_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
app:layout_constraintTop_toBottomOf="@id/pets_for_sale_text">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<GridView
android:id="@+id/listing_GridViewLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:numColumns="auto_fit"
android:padding="5dp"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</GridView>
<!--<View-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="400dp"-->
<!--android:layout_below="@id/listing_GridViewLayout"-->
<!--android:layout_marginTop="0dp"-->
<!--android:id="@+id/simulate_bottom_margin_view" />-->
</LinearLayout>
</ScrollView>
我尝试了许多解决方案,包括添加填充ScrollView
或LinerLayout
什么都不做。还尝试在底部添加额外的视图以创建额外的填充,也没有任何作用。任何帮助/建议将不胜感激。
(看看第二张网格图片,看看有什么问题,第一个网格是我想要达到的结果)
解决方案
请尝试将 Scrollview 的高度更改为 Match_parent
推荐阅读
- swift - 在哪些情况下 ARSCNView.raycastQuery 返回 nil?
- visual-studio - 如何解决 CS1503 将方法组转换为对象
- python - 是否可以在 pandas 聚合函数中包含 scipy.stat 函数?
- bash - 如何使用另一个带有循环的作业提交连续的 bash 作业
- php - 在 PHP 中的两个感叹号之间进行匹配
- javascript - 使用道具时无法更改 TextInput 中的值
- ibm-cloud - 无法正确配置质量和漂移监视器
- google-cloud-platform - 谷歌云功能部署开始失败
- javascript - 如何将字符串推入数组?
- node.js - Nest.Js 不接受任何更改