I've got FrameLayout
which consists of EditText
and ImageButton
and looks like this:
In the code it looks like this:
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/input_field_red"
android:hint="Message"
android:singleLine="true"
android:textColor="@color/dark_grey_3" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@android:color/transparent"
android:src="@drawable/cancel" />
</FrameLayout>
Problem is, when input text becomes long enough, ImageButton
overlays the text.
Is there a way to prevent this? I mustn't shorten the length of the line. It has to be match_parent
. And ImageButton
must be positioned on the line and aligned to right.