我使用片段使用ImageView
显示图片,ScrollView
在图片视图下方显示TextView
RelativeLayout
中的xml
}。现在的问题是,如图所示 here ,在启用导航栏时,图像和滚动视图之间会创建一个空格。
通过在开发者选项中启用 show layout bounds ,可以看到创建空白区域的图像视图,如 here 。在Eclipse的图形布局中查看时没有这样的空间。
这是我片段的<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
android:src="@drawable/city_image" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:clipToPadding="false"
android:fitsSystemWindows="true" >
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:padding="16dp"
android:text="@string/fragment_main" />
</ScrollView>
</RelativeLayout>
gravity
我是Android的新手,如果我犯了一个愚蠢的错误,我道歉。我尝试将滚动视图的layout_height
更改为顶部,同时也使用{{1}}。但仍然无法弄清楚我的xml有什么问题。