I have designed the screen using this relative layout.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<AutoCompleteTextView
android:id="@+id/EditText01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" />
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_alignRight="@+id/EditText01"
android:src="@android:drawable/ic_notification_clear_all" />
<AutoCompleteTextView
android:id="@+id/EditText02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/EditText01" />
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="24dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/EditText02"
android:src="@android:drawable/ic_notification_clear_all" />
What changes should i do so that the image is right aligned to the auto-complete text box.??
Thanks in advance..
P.S: Since i don’t have the reputation to upload the picture.Here is the link https://i.stack.imgur.com/SRG9W.png
android:layout_alignRight="@+id/EditText01"means that your button wants his right edge aligned with the EditTexts right edge. What you actually want is that the buttons left edge is aligned with the EditTexts right edge. That isandroid:layout_toRightOf="@+id/EditText01"Edit – that’s what you want I guess