I have 3 Linear Layouts inside a Relative Layout. It seems to be working in emulator and on physical device, however in Eclipse it's completely off.
I am not sure whether there is some mistake in my code or this some normal behavior of Eclipse.
The code is:
<RelativeLayout 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"
tools:context=".MainActivity" >
<LinearLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:background="#E89745"
android:layout_alignParentTop="true"
android:layout_above="@+id/logins"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="header"
android:gravity="center"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/logins"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#F7E7AB">
<EditText
android:id="@+id/EditText01"
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
<EditText
android:id="@+id/EditText02"
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
<Button
android:id="@+id/Button01"
android:text="Button"
android:layout_height="wrap_content"
android:layout_width="match_parent"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_below="@+id/logins"
android:layout_alignParentBottom="true"
android:background="#61A179"
android:gravity="center"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="footer" />
</LinearLayout>
</RelativeLayout>
What it looks like in Eclipse:
And in emulator and on device: