【发布时间】:2014-02-06 14:55:44
【问题描述】:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:scaleType="fitStart"
android:src="@drawable/splash_bg" />
<ImageView
android:id="@+id/photo_area"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_margin="20dp"
android:adjustViewBounds="true" />
<TextView
android:id="@+id/share_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/photo_area"
android:layout_marginLeft="20dp"
android:text="@string/share_title"
android:textColor="@android:color/white" />
<EditText
android:id="@+id/share_content"
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="@+id/share_title"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/custom_textarea"
android:gravity="top|left"
android:hint="default message" />
<ImageView
android:id="@+id/share_submit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/share_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:src="@drawable/photo_taken_btn_submit" />
</RelativeLayout>
</ScrollView>
这是布局的xml。 photo_area 默认没有图像设置,但它会从互联网上下载一张图片并在上面设置。问题是内容视图的高度比它应该的要长,所以最后有很多空白空间。我尝试在线性布局中删除背景,高度降低了一点,但仍然有一些空白空间如何解决?谢谢
【问题讨论】:
标签: android android-layout height android-scrollview