i have a layout titled "status2.xml" and its code is posted below. and i have a main layout titled "meine_vertaege.xml" and its code is posted below as well. the "act_main.xml" includes the aforementioned layouts, which are namely "status2.xml" and "meine_vertaege.xml".
I am including "status2.xml" and "meine_vertaege" in the "act_main.xml" as shown below in the code of the "act_main.xml".
the problem i have is when i include both of "status2.xml" and meine_vertaege" in the "act_main.xml", i cant see the entire contents of the "status2.xml" because it seems that the contents of "status2.xml" and "meine_vertaege.xml" got mixed up
please let me know how to include both of "status2.xml" and "meine_vertaege" in "act_main.xml" so that i can see their entire contents in such way that they are organized vertically
status2.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:paddingStart="10dp"
android:gravity="center_vertical"
android:text="Status"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="3dp"
android:layout_weight="5">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:paddingStart="10dp"
android:text="vertraege"/>
</LinearLayout>
</LinearLayout>
output of status2.xml:
meine_vertaege.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/actMain_meine_vertraege_layout_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="@dimen/padding">
<TextView
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/gray"
android:gravity="center_vertical|start"
android:paddingStart="@dimen/padding"
android:text="Meine Verträge" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/actMain_lisVie"
android:layout_width="match_parent"
android:layout_height="match_parent"></ListView>
</ScrollView>
</LinearLayout>
output of meine_vertaege.xml:
act_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:context="com.example.bestandlayout_00.ActMain">
<include
android:id="@+id/lay1"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/status2"></include>
<include
android:id="@+id/lay2"
android:layout_width="match_parent"
android:layout_height="match_parent"
layout="@layout/meine_vertaege"></include>
</LinearLayout>
output of act_main.xml:
Try like this .
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<include
android:id="@+id/lay1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1dp"
layout="@layout/status2"></include>
<include
android:id="@+id/lay2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1dp"
layout="@layout/meine_vertaege"></include>
</LinearLayout>