android - Scrollview 在布局底部添加了额外的空间
问题描述
在我的活动中,滚动视图在页面底部添加了额外的空间。我也尝试在 stackoverflow 上查找,但没有任何反应。我已经尝试了一切,但没有一个对我有用..请帮助
这是我的xml代码-
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:id="@+id/spinner"
android:background="#fff"
android:layout_marginRight="12dp"
android:layout_marginLeft="12dp"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_width="match_parent"
android:layout_height="45dp"/>
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/spinner"
android:scrollbars="none"
android:overScrollMode="never"
tools:adjustViewBounds="true"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_marginRight="12dp"
android:layout_marginLeft="12dp"
android:fillViewport="true">
<ImageView
android:id="@+id/image"
android:src="@drawable/basic_01"
android:scaleType="fitStart"
android:focusableInTouchMode="true"
android:layout_below="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</ScrollView>
</RelativeLayout>
<android.support.design.widget.NavigationView
app:headerLayout="@layout/header"
android:layout_width="350dp"
android:layout_height="match_parent"
app:menu="@menu/nav_header"
android:id="@+id/navigation_view"
android:layout_gravity="start">
</android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
解决方案
您已经添加android:layout_marginBottom="8dp"
了ScrollView
这就是为什么它在布局底部添加了额外的空间
从android:layout_marginBottom="8dp"
您的ScrollView
推荐阅读
- moodle - 如何在 Moodle 中过滤具有非空值的记录?
- database - 如何在 acumatica 中创建自定义字段时将自定义 DB 字段作为某个值而不是 null
- c# - 模型和表上的值一直显示为空
- css - CSS选择所有后代中的最后一个元素
- vb.net - BackgroundWorker 中的 TWAIN 事件
- html - Angular:在 html 模板中使用三元运算符
- javascript - 下个月的时刻检查
- typescript - 时刻:格式化日期时添加+1个月
- c - 进程可以读取自己的标准输出/标准错误吗?
- migrate - django.db.utils.ProgrammingError:在我尝试将 Hstorefield 添加到我的模型后无法调整类型“dict”