Search code examples
androidandroid-mapview

How to set round corners MapView widget


How to set round corners MapView widget?

his is my MapView

<com.google.android.gms.maps.MapView
                android:id="@+id/map_view"
                android:layout_width="match_parent"
                android:layout_height="260dp"
                app:liteMode="true"
                app:mapType="normal" />

thanks


Solution

  • you may try cardview as view parent

    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="260dp"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="20dp"
        app:cardCornerRadius="20dp"
        app:cardElevation="0dp">
    
        <com.google.android.gms.maps.MapView
                    android:id="@+id/map_view"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:liteMode="true"
                    app:mapType="normal" />
    </android.support.v7.widget.CardView>