我在 Android Studio 调色板中找不到 map View 。我正在使用新的 Android Studio,它看起来很傻,但我找不到它。我查看了开发站点,但似乎 mapview 仍然存在。
有什么我想念的吗?
我还尝试将它添加到 XML 中,但它说找不到 mapview 类。
最佳答案
在 Android Studio(以及 IntelliJ)中,调色板中没有 MapView
。如果您需要在布局中使用 map ,请使用以下声明:
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
Google Maps Android API v2 documentation
There您对如何使用 map v2 有很好的引用。
我们在 Android map v1 中使用了 MapView
,但现在它已被弃用 (reference)。所以这就是Android Studio调色板中没有MapView
的原因。
关于android - Android Studio 中的 MapView 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16878376/