Wie plaziere ich Tablayout unter der Symbolleiste? Es gibt mir eine Fehlermeldung und wenn ich es ausführe, wird die Symbolleiste nicht angezeigt. Aber wenn ich die Tablayout geben alignbottom die Symbolleiste dann zeigtWie lege ich Tablayout unter meine Titelleiste?
Hier ist meine XML-Datei
<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"
android:id="@+id/rel"
tools:context="com.example.test.MainActivity">
<include
android:id="@+id/app_bar"
layout="@layout/toolbar"/>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/nvd_act_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/app_bar"
>
<FrameLayout
android:id="@+id/cont_main_content"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/lbl_act_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Hello World!" />
</FrameLayout>
<android.support.v7.widget.RecyclerView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/lst_nav_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start|left"
android:background="@android:color/white"
app:layoutManager="android.support.v7.widget.LinearLayoutManager" />
</android.support.v4.widget.DrawerLayout>
<RelativeLayout
android:id="@+id/footer"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:background="#2480c1"
android:gravity="center"
android:layout_gravity="center">
<android.support.design.widget.TabLayout
android:id="@+id/tbl_basic"
android:layout_height="wrap_content"
android:layout_width="match_parent">
</android.support.design.widget.TabLayout>
<TextView
android:id="@+id/lbl_basic_content"
android:layout_below="@id/tbl_basic"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
android:textColor="@android:color/black" />
</RelativeLayout>
</RelativeLayout>
Hier ist der Bildschirm i erstellt, die tablayout ist im Boden. Ich möchte, dass es direkt unter der Symbolleiste ist. Wie mache ich es?
DankHier ist die Fehlermeldung
@ id/rel keine Geschwister in der gleichen RelativeLayout Layoutbeschränkungen in einem bestimmten RelativeLayout ist, sollte andere Ansichten innerhalb der gleichen relativen Layout verweisen (aber nicht ! selbst)
‚Es gibt mir eine Fehlermeldung‘ - Es wäre hilfreich für Leute, die Ihre Frage überprüfen, damit Sie die Fehlermeldung posten können. – dominicoder