<LinearLayout android:orientation="horizontal"...>
But I have also a TextView and I didn't want that TextView appear in the same row as the EditText and the button.
Thanks for helping me.You can do this in many ways.
- Linear layout
- Relative Layout
- Table Layout.
Using linear layout - You can put one linear layout 'A' at top and set its orientation "vertical". Now put two child nodes inside it one new linear layout 'B' and one textview. In new linear layout you set its orientation "horizontal" and then add button, edittext in it.
Following is code:
<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_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:text="EditText"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:width="250dp"></EditText>
<Button
android:text="Button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
</LinearLayout>
<TextView
android:text="TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</TextView>
</LinearLayout>
Try using RelativeLayout
in your xml.
精彩评论