2016-05-21 9 views

Antwort

0

Sie unter Code verwenden können.

<?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

Ich verwende das lineare Layout. Es gibt eine Möglichkeit, es mit linearem Layout zu tun. – dev

+0

kann ich es mit Rahmenlayout im linearen Layout tun? – dev

+0

Ja, Sie können es versuchen ... Verwenden Sie dies in linearlayout, weil RelativeLayout nur für diese Art von Layout ist. –

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> 
+0

Lesen Sie seine Frage richtig. Ich möchte den 'Button' im' editText'. –

+0

Ya, ich habe dies über Code mit einigen Änderungen lyk, Thanx – dev

Verwandte Themen