android - nested linearlayout is not working properly -
i want edittext , send button in 1 row image in other row ...but using code edit text,send button,and image displaying in 1 row..can please tell me should display image in other row
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:orientation="horizontal" tools:context=".mainactivity" > <edittext android:id="@+id/edit_message " android:layout_weight="1" android:layout_width="0dp" android:layout_height="wrap_content" android:hint="@string/edit_message"/> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/button_send" android:onclick="sendmessage" /> <linearlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <imageview android:id="@+id/imageview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/logo" /> </linearlayout> </linearlayout>
you wrap edittext
, button
in linearlayout
<linearlayout android:orientation="vertical" ...> <linearlayout ...> <edittext .../> <button .../> </linearlayout> <imageview .../> </linearlayout>
but use relativelayout
<relativelayout ...> <edittext android:id="@+id/et" .../> <button android:layout_torightof="@id/et" .../> <imageview android:layout_below="@id/et" .../> </relativelayout>
but depends on want things.
Comments
Post a Comment