如何消除对滚动型顶部空白的表现 [英] How to remove white space showing on top of scrollView

查看:187
本文介绍了如何消除对滚动型顶部空白的表现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下滚动视图。一切工作完全按照我想要的,除了:还有就是滚动型的顶部和ImageView的顶部之间的空白。我要的是对图像的顶部被刷新。这将是巨大的,如果滚动视图不会滚动过去的图像的底部边缘为好。感谢所有的建议。

 <滚动型
    机器人:layout_width =match_parent
    机器人:layout_height =WRAP_CONTENT
    机器人:滚动条=无>    <的LinearLayout
        机器人:layout_width =match_parent
        机器人:layout_height =WRAP_CONTENT
        机器人:layout_gravity =顶
        机器人:方向=垂直>        < ImageView的
            机器人:ID =@ + ID /欢迎
            机器人:layout_width =match_parent
            机器人:layout_height =WRAP_CONTENT
            机器人:layout_gravity =顶
            机器人:scaleType =fitCenter
            机器人:SRC =@绘制/ welcome_page/>
    < / LinearLayout中>
< /滚动型>


解决方案

要删除顶部空间,尝试使用

 的android:scaleType =fitStart

在ImageView的。至于底部空间去除,也许别人可以帮你。

I have the following scrollView. Everything works exactly as I want, except: there is a white space between the top of the scrollView and the top of the ImageView. What I want is for the image to be flushed at the top. It would be great too if the scrollView does not scroll past the bottom edge of the image as well. Thanks for all suggestions.

<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:scrollbars="none" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top"
        android:orientation="vertical" >

        <ImageView
            android:id="@+id/welcome"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:scaleType="fitCenter"
            android:src="@drawable/welcome_page" />
    </LinearLayout>
</ScrollView>

解决方案

To remove the top space, try using

android:scaleType="fitStart"

in the ImageView. As for the bottom space removal, maybe someone else can help you with that.

这篇关于如何消除对滚动型顶部空白的表现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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