gpt4 book ai didi

Android ScrollView 不尊重 child 的底部边距

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:38:33 25 4
gpt4 key购买 nike

我有一个类似下面的 android layout_file

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
android:id="@+id/post_ride_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/activity_margin"
android:padding="@dimen/activity_margin"
android:background="@drawable/google_now_style_card"
android:orientation="vertical" >

...

</LinearLayout
</ScrollView

@dimen/activity_margin 为 16dp

当我运行应用程序时,我无法滚动到整个布局的底部,因为它不会显示底部边距。这张图说明了

enter image description here

请注意已到达布局底部的提示(底部的发光),但右侧的滚动条表明还有更多内容需要向下滚动。

我期望发生的是能够看到底部的边距,就像布局侧面的边距一样。

最佳答案

尝试设置

android:fillViewport="true"

在你的 ScrollView 中。它会给它全高,然后你可以应用底部边距。

关于Android ScrollView 不尊重 child 的底部边距,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22884169/

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