I'm writing an Android app, I have a EditText on top, several bottoms on bottom. I implemented this using Relative layout.
In the middle I have a TextView. But the problem is that it occupies all the space under the EditText including the space where the buttons are.
I want it to end right before the buttons. How can I do that?
I would do that layout like this:
<RelativeLayout android:width="fill_parent"
android:height="fill_parent">
<EditText android:id="@+id/top_Layout"
android:width="fill_parent"
android:height="wrap_content"
android:layout_alignParentTop="true"/>
<LinearLayout android:id="@+id/buttons"
android:width="fill_parent"
android:height="wrap_content"
android:layout_alignParentBottom="true"/>
<RelativeLayout android:id="@+id/center_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/top_Layout"
android:layout_above="@id/buttons"/>
</RelativeLayout>
Put your buttons in a linearLayout(orientation=horizontal). Use layout_alignParentBottom to put this linearLayout at the bottom. Similarly, use layout_alignParentTop for your editText.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With