Android – how to display MapView in cardview?
•
Android
I need to use MapView in cardview by getting the current location
Your answer will be appreciated. Thank you in advance
resolvent:
I think it will work:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Sum text if you need" />
<com.google.android.gms.maps.MapView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
Cardview itself is just an ordinary FrameLayout with few aesthetic additions. Therefore, you can add anything you need
Docs from cardview:
From the perspective of layout, you need several additional settings to make MapView work. Here are some resources where you can learn more:
>Official guide, tutorial on MapView V2 from Google developers. > vogella
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码