android - LinearLayout Line up -
i have edittext , want imagebutton left of it. want edittext's width fill_parent except leave room imagebutton. right edittext isn't leaving room. have them nested in linearlayout.
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:layout_height="wrap_content" android:id="@+id/linearlayout1" android:layout_width="fill_parent" android:orientation="horizontal" > <edittext android:id="@+id/edittext1" android:layout_marginleft="10dp" android:layout_height="wrap_content" android:layout_marginright="10dp" android:layout_width="fill_parent" /> <imagebutton android:id="@+id/imagebutton1" android:layout_height="wrap_content" android:src="@drawable/icon" android:layout_width="wrap_content" /> </linearlayout> ... </linearlayout>
change android:layout_width="0dp"
, add android:layout_weight="1"
edittext.
Comments
Post a Comment