Android:错误 Snack bar 未在地图视图中正确显示

Android : Error Snack bar not showing correctly with Map View

这是 xml 布局

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/map_location_picker_main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.mapbox.mapboxsdk.maps.MapView
            android:id="@+id/map_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    </android.support.design.widget.CoordinatorLayout>

这是输出:

我正在使用 CoordinatorLayout 作为我的 xml 文件mapbox 显示地图的布局。 我不知道发生了什么,请帮助我。

只需在 MapView 之上创建一个视图并在其中显示 snackbar :))

布局:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:mapbox="http://schemas.android.com/apk/res-auto"
    tools:context=".MainActivity">

    <com.mapbox.mapboxsdk.maps.MapView
        android:id="@+id/mapView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <View
        android:id="@+id/snackbarView"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Activity:

val snackbar = Snackbar.make(snackbarView, "Message :))", Snackbar.LENGTH_LONG)
snackbar.show()