首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android Google Maps: XML布局错误

Android Google Maps: XML布局错误
EN

Stack Overflow用户
提问于 2013-08-24 22:37:38
回答 2查看 1.8K关注 0票数 0

我正在尝试让谷歌地图v2工作在安卓使用安卓工作室。我拿到了我所有的钥匙和货单。当我尝试为映射将显示的实际活动创建xml时,我得到了错误。我的xml如下所示:

代码语言:javascript
复制
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:context=".MainActivity" >

    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              class="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>

我在android studio中的错误如下所示:

EN

回答 2

Stack Overflow用户

发布于 2013-08-24 22:47:40

这也会发生在我身上。只需清理项目即可。

票数 1
EN

Stack Overflow用户

发布于 2014-08-25 06:51:24

您好,您必须在xml文件中使用以下代码:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:name="com.google.android.gms.maps.SupportMapFragment"/>
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18419695

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档