Ich versuche, xml_layoutA
in xml_layoutB
aufzunehmen.warum das Hinzufügen von <merge> das Android-Layout ändert?
Zuerst wusste ich nicht, ich <merge>
Tag in xml_layoutA
hinzuzufügen haben.
aber dann habe ich diesen Tag und dann die xml_layoutA
begann ausgerichtet werden zum nach wie vor links statt rechts.
Was hat diese Änderung verursacht?
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>
beiden Fälle in denselben 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" />
mögliche Duplikat von [Was ist der Zweck von Android-Tag in XML-Layouts?] (Http://StackOverflow.com/Questions/8834898/what-is-the-purpose-of-androids-merge-Tag-in -xml-Layouts) –
guptakvgaurav
nein. hier habe ich linearLayout innerhalb relativerLayout. sie sollten irgendwie zusammengeführt werden –