I have this in my fragment xml file:
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.gelasoft.answeringball.MainActivity$PlaceholderFragment"
android:background="@drawable/wg_blurred_backgrounds_14"
>
<ImageView
android:id="@+id/sphereIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:contentDescription="@string/magicBallDescr"
android:src="@drawable/rsz_31mystic" />
<LinearLayout
android:id="@+id/table"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/sphereIcon"
android:orientation="vertical" >
<TextView
android:id="@+id/txtAnswer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<EditText
android:id="@+id/txtQuestion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:hint="@string/textHint"
android:inputType="textMultiLine"
android:lines="6" />
<Button
android:id="@+id/btnAsk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/btnAskQ"
android:paddingEnd="@dimen/activity_vertical_margin"
/>
</LinearLayout>
</RelativeLayout>
and here is how it looks:
Now I would like to set a different background image on the EditText
, so I edited the xml and make it like:
<EditText
android:id="@+id/txtQuestion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:hint="@string/textHint"
android:inputType="textMultiLine"
android:lines="6"
android:background="@drawable/background"/>
But Now the background I set on the EditText
is taking the wholw LinearLayout
space.
Here is how it looks in the editor after the changes:
Why is it taking the whole place and hiding the button?
What am I missing here? I'm sure it is something pretty small, but I'm not able to spot it.