首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >地图片段渲染错误

地图片段渲染错误
EN

Stack Overflow用户
提问于 2017-07-18 19:11:36
回答 1查看 483关注 0票数 0

我正在尝试使用以下XML构建一个map活动:

代码语言:javascript
复制
<com.google.android.gms.maps.MapView
    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/mapView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<fragment
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.getfamiliarwiththemap.MapsActivity" >



    <LinearLayout
        android:id="@+id/mLlayoutBottomButtons"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_alignParentBottom="true"
        android:orientation="vertical" >

    <Button

    android:id="@+id/ok"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Select"
    android:textColor="#ffec00"
    android:background="#b600ff"
        android:layout_marginBottom="5dp"
        android:layout_marginTop="500dp"
        android:layout_marginLeft="150dp"
        android:layout_marginRight="150dp"

    />

    </LinearLayout>

</fragment>

    </com.google.android.gms.maps.MapView>

我一直收到渲染错误:未知片段。有人能教我手动安装google play服务SDK的正确方法吗?我有一个名为google_play_services的文件夹,这就是我要使用的全部内容。

EN

回答 1

Stack Overflow用户

发布于 2017-07-18 19:41:12

尝试使用class而不是android:name

代码语言:javascript
复制
<fragment
    android:id="@+id/map"
    class="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.getfamiliarwiththemap.MapsActivity" >
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45165123

复制
相关文章

相似问题

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