Android的滚动型不尊重孩子的底边距 [英] Android ScrollView not respecting child's bottom margin

查看:398
本文介绍了Android的滚动型不尊重孩子的底边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个机器人layout_file,看起来像下面这样

I have an android layout_file that looks something like the following

<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

@扪/ activity_margin 是16DP

当我运行的应用程序,我无法滚动到整个布局的底部,如,它不会显示在底部边缘。这张照片澄清

When I'm running the app, I am unable to scroll to the bottom of the entire layout, as in, it won't display the bottom margin. This picture clarifies

注意,暗示的布局的底部已达到(从底部发光),但是在右侧的滚动条表示有更多的向下滚动到

Note that the hint that the bottom of the layout has been reached (the glow from the bottom), yet the scrollbar on the right indicates that there is more to scroll down to.

我希望发生的是能够看到利润率在底部,就像在布局的侧边缘。

What I expect to happen is to be able to see the margin at the bottom, just like the margins at the side of the layout.

推荐答案

尝试设置

android:fillViewport="true"

在您的滚动型。它将给它全高和那么你可以申请下边距。

in your ScrollView. It will give it full height and then you can apply bottom margin.

这篇关于Android的滚动型不尊重孩子的底边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆