Как заставить ListView располагаться под определенным элементом? - PullRequest
0 голосов
/ 27 мая 2020

Я пытаюсь разместить ListView на панели инструментов, но первый элемент устанавливается прямо на панели инструментов, не могли бы вы мне помочь?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/holo_blue_bright">
    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/cardview_light_background"
        android:minHeight="?attr/actionBarSize"
        >
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="invites_fragment"
            android:textSize="30sp"
            android:layout_centerInParent="true">
        </TextView>
    </androidx.appcompat.widget.Toolbar>
    <ListView
        android:id="@+id/chatList"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</RelativeLayout>

1 Ответ

0 голосов
/ 27 мая 2020

Просто добавьте свойство в ListView

android:layout_below="@+id/toolbar”

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...