I'm using the following layout XML
The problem is that the imageview takes up much more height then the image needs, adding a lot of blank space between the top of the screen and the following textview (tvDescription).
I'd like for the Image to scale to be the size of one screen (as if the only view in the layout was the ImageView) and the user would scroll down to see the other controls. Is this possible?
Code:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10px">
<ImageView android:id="@+id/ivImage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scaleType="fitCenter">
</ImageView>
<TextView android:id="@+id/tvDescription"
android:text="Description:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ivImage">
</TextView>
<EditText android:id="@+id/etDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/tvDescription">
</EditText>
<Button android:id="@+id/btnSend"
android:layout_below="@id/etDescription"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="Send">
</Button>
</LinearLayout>
</ScrollView>
I'd like for the Image to scale to be the size of one screen (as if the only view in the layout was the ImageView) and the user would scroll down to see the other controls. Is this possible?