[英]Map fragment rendering errors
我正在嘗試使用以下XML構建地圖活動:
<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的文件夾,這就是我要使用的所有文件夾。
嘗試使用class
而不是android:name
:
<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" >
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.