Skip to content Skip to sidebar Skip to footer

Android : Error Snack Bar Not Showing Correctly With Map View

this is xml layout

Solution 1:

Just create a view on top of MapView and show snackbar within it :))

Layout:

<?xml version="1.0" encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayoutxmlns: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.MapViewandroid:id="@+id/mapView"android:layout_width="match_parent"android:layout_height="match_parent"/><Viewandroid: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()

Post a Comment for "Android : Error Snack Bar Not Showing Correctly With Map View"