I need to design almost similar structure as defined in Adding component at the bottom
I followed the answer given in that thread. But my problem is, if I use tag to import another xml which has some components in LinearLayout and if I try to add that xml in my xml having RelativeLayout, the component which was imported using tag won’t go to the bottom of the screen. But strangely, if I replace that imported component with some component like a button in that same xml, the button goes to the bottom. Please help me.
Here’s the code-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<!-- Title Bar -->
<include
android:layout_alignParentTop="true"
android:id="@+id/title_bar"
layout="@layout/title_bar"
android:layout_marginBottom="1dip"/>
<!-- Options Bar -->
<include
android:layout_alignParentBottom="true"
android:id="@+id/options_bar"
layout="@layout/options_bar"
/>
<!--
<Button android:layout_alignParentBottom="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Test"/>
-->
</RelativeLayout>
Every thing look fine. Please 1st check you
option_bar.xml. I am thinking the issue is its height. May be you have set theoption_bar.xmlandroid:layout_height = “fill_parent”
If so then please change it to “wrap_content” or “match_parent”.