ABSM的GoogleMaps - Xamarin

时间:2014-08-26 20:57:09

标签: android android-fragments xamarin google-maps-android-api-2 xamarin-studio

我有一个类来创建一个包含地图的片段,但是发生了以下错误:

错误夸大类片段

我的LayoutMap.axml文件:

`<?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"
        class="com.google.android.gms.maps.MapFragment" />`

我的Activity_TabMap:

public override void OnActivityCreated(Bundle saveInstanceState)
    {
        base.OnActivityCreated (saveInstanceState);

        _mapaFragment = SupportMapFragment.NewInstance ();

        GoogleMap googleMap = ((SupportMapFragment)(FragmentManager.FindFragmentById (Resource.Id.map))).Map;

        googleMap.MapType = GoogleMap.MapTypeNormal;

    }

    public override  View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    {
        return inflater.Inflate (Resource.Layout.LayoutMap, container, false);
    }

0 个答案:

没有答案