I have a layout with a custom ImageView, and two TextEdits; one above and one below. To make this fit on multiple screens I have surrounded the whole thing with a ScrollView.
However, when the ScrollView is added a massive gap (approx. the height of the screen) appears between the top TextEdit and the ImageView, and the ImageView and the bottom TextEdit.
I am only overriding the onDraw()
method in the ImageView (and am still calling super.onDraw()
from there)
This is my layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/top_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="@string/top_hint" >
<requestFocus />
</EditText>
<com.javanut13.gememerator.MImageView
android:id="@+id/image_viewer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:src="@drawable/ic_action_search" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/bottom_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:layout_weight="3"
android:hint="@string/bottom_hint" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/button_text" />
</LinearLayout>
</LinearLayout>