我在 中编写了一个Google Maps
应用程序Xamarin
,并收到此错误:
Android.Views.InflateException: Binary XML file line #1: Error inflating class fragment
运行以下代码行时出现此错误:
SetContentView(Resource.Layout.MapWithOverlayLayout);
这是我的MapWithOverlayLayout.axml
布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment class="SimpleMapDemo.MapWithMarkersActivity"
android:id="@+id/mapWithOverlay"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
命名空间被称为:SimpleMapDemo
这是我的班级声明:
public class MapWithMarkersActivity : Android.Support.V4.App.FragmentActivity
我正在使用一个SupportMapFragment
对象来显示谷歌地图
我可以请一些帮助以使此代码正常工作吗?