我在Android Studio中尝试编写Google Map V2的测试演示。我按照Androidhive Google Map V2中的每个步骤进行,或者更好的说,我认为我需要这样做。
我正在使用相同的layout_main.xml文件。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
但我一直遇到相同的渲染问题:
渲染问题
<fragment>
标签允许布局文件在运行时动态包含不同的布局。在布局编辑时无法确定要使用的特定布局。您可以选择在编辑布局时预览要使用的布局...
我完全不知道问题出在哪里。我是否忘记了什么? 我只需要像这样在 build.gradle 中添加 Google 服务:
compile 'com.google.android.gms:play-services:4.4.52'
我从演示文稿中复制了清单(manifest)并更改了API密钥。
tools:layout="@android:layout/simple_gallery_item
- Lance Samaria