0

I want the Button inside the editText. I am attaching the screen shot. How can I do this? Please help me.

Something like this:

img

JAY RAPARKA
  • 1,353
  • 2
  • 13
  • 33
dev
  • 11
  • 1
  • 6

2 Answers2

0

you can use below code.

<?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="wrap_content" >

    <EditText
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:hint="Enter search key" />

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_margin="5dp"
        android:text="Verify"/>

</RelativeLayout>
0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >

    <EditText
    android:layout_gravity="1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Mobile no" >

    <Button
    android:id="@+id/button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Verify"/>

    </EditText>

</LinearLayout>
Mrugesh
  • 4,381
  • 8
  • 42
  • 84