【发布时间】:2014-05-18 06:44:06
【问题描述】:
我在Xamarin 中编写了一个Google Maps 应用程序,并收到此错误:
Android.Views.InflateException:二进制 XML 文件第 1 行:错误 膨胀类片段
运行以下代码行时出现此错误:
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 对象来显示 Google 地图
能否请我帮忙让这段代码正常工作?
【问题讨论】:
标签: android-layout android-fragments xamarin android-fragmentactivity inflate-exception