Scrollview空白空间问题

时间:2016-01-26 18:20:19

标签: android android-layout

How to clear this empty space

我想在我的应用程序中创建指南,但我发现这个空白空间位于我的图像之上,如何删除它以让我的图像保持在顶部?下面是我的layout.xml代码。< / p>

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".InfoActivity">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    >
    <ImageView
    android:id="@+id/slide1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/slide1"
    android:contentDescription="firstslide" />
    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="@string/HELLO"
    android:id="@+id/textView"  />

</LinearLayout>
</ScrollView>
</LinearLayout>

2 个答案:

答案 0 :(得分:1)

尝试在ImageView中添加此内容。

android:scaleType="fitStart"

希望它有所帮助。

答案 1 :(得分:0)

我用android修改了它:scaleType =&#34; fitXY&#34;

相关问题