我試圖下面教程的MapView http://docs.xamarin.com/guides/android/platform_features/maps_and_location/part_2_-_maps_api無法顯示的MapView
我已經加入
1)單聲道,Android.Googlemaps使用Androis.Locations
2); 3)實現的:公共類活性1:MapActivity
這些是錯誤消息:
-1-錯誤CS0115: 'MapView.Activity1.IsRouteDisplayed':發現重寫(CS0115沒有合適的方法)(MapView類)
-2-錯誤CS0246:類型或命名空間名稱「MapActivity」找不到(是否缺少using指令或程序集引用?)(CS0246)(MapView類)
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.google.android.maps.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="wrap_content" android:apiKey="my google map key here" /> </LinearLayout> [Activity (Label = "MapView", MainLauncher = true)] public class Activity1 : MapActivity { protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.Main); } protected override bool IsRouteDisplayed { get { return false; } } }
會感謝你的幫助在這。
感謝
谷歌地圖V1是deprciated。您應該使用[Android Google Map V2](https://developers.google.com/maps/documentation/android/)。謝謝 – captaindroid
@captaindroid:謝謝。我遵循http://docs.xamarin.com/guides/android/platform_features/maps_and_location/part_2_-_maps_api,使用Adroid SDK Manager安裝Google API(14級及以上版本)並創建了AVD並添加了參考。我做對了嗎?仍然會出錯。請幫忙。 – MilkBottle
檢查並使用正確的AVD,現在錯誤消息是:錯誤CS0246:無法找到類型或名稱空間名稱'MapActivity'(您是否缺少using指令或程序集引用?)(CS0246)(MapView)這是什麼手段? – MilkBottle