我试着在Android Studio中为Google Map V2编写测试演示.我从Androidhive谷歌地图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>
Run Code Online (Sandbox Code Playgroud)
但我总是得到相同的渲染问题:
呈现问题
一个<fragment>标签允许布局文件,以动态地包括在运行时不同的布局.在布局编辑时,要使用的特定布局是未知的.您可以在编辑布局时选择要预览的布局...
我完全不知道问题是什么.我忘记了什么吗?我只需要在build.gradle中添加Google服务
compile 'com.google.android.gms:play-services:4.4.52'
Run Code Online (Sandbox Code Playgroud)
我从演示中复制了清单并更改了API密钥.