Я использую AppCompatActivity
и в данный момент пытаюсь добавить навигационный ящик на панель инструментов.
Проблема в том, что теперь карточка не отображается и навигационный ящик тоже не работает.
Это мой код:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="150dp">
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/cards"
android:layout_gravity="center"
android:layout_width="match_parent"
android:layout_height="200dp"
card_view:cardCornerRadius="4dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:padding="10dp"
android:layout_alignParentBottom="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Username"
android:id="@+id/usersName"
android:layout_alignParentTop="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Others"
android:id="@+id/others"
android:layout_centerVertical="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.design.widget.NavigationView
android:layout_width="wrap_content"
android:layout_height="match_parent"></android.support.design.widget.NavigationView>
</android.support.v4.widget.DrawerLayout>
Это действительно много значило бы и сделало бы мой день, если бы кто-нибудь мог исправить мою ошибку, пожалуйста. Я не знаю, где я ошибся, и я просто хочу, чтобы кнопка ящика навигации была на панели инструментов, а карточка на экране