I try to include xml_layoutA
into xml_layoutB
.
At first I didn't know i have to add <merge>
tag in xml_layoutA
.
but then I added this tag and then the xml_layoutA
started being aligned to left instead of to the right as before.
What has caused this change?
xml_layoutA.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tooltip_layout"
android:layout_width="262dp"
android:layout_height="92dp"
android:background="@drawable/tip_tool_top_right"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="15dp"
android:paddingLeft="5dp"
android:paddingRight="10dp" >
<LinearLayout
...
</LinearLayout>
</LinearLayout>
vs.
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:id="@+id/tooltip_layout"
android:layout_width="262dp"
android:layout_height="92dp"
android:background="@drawable/tip_tool_top_right"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="15dp"
android:paddingLeft="5dp"
android:paddingRight="10dp" >
<LinearLayout
...
</LinearLayout>
</LinearLayout>
</merge>
both case in same xml_layoutB.xml
in RelativeLayout
:
<include
android:id="@+id/tooltipFriends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/friendsonline_bar"
android:layout_alignParentRight="true"
android:visibility="visible"
layout="@layout/tooltip_friends" />