我正在做一个辅助功能项目,需要使用 API 地图。我在 Android Studio 中看不到地图。出现此错误:
Unknown Fragments - The <fragment> tag allows the layout file to dynamically include different layouts at runtime. At layout editing time the specific layout to be used is not known. You can choose which layout you would like previewed while editing the layout.
- <fragment com.google.android.gms.maps.SupportMapFragment ...> (Pick Layout ...)
Do not warn about <fragment> tags in this session.
Run Code Online (Sandbox Code Playgroud)
有没有人有办法解决吗?
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" />
Run Code Online (Sandbox Code Playgroud)