【发布时间】:2013-08-06 12:10:23
【问题描述】:
我正在开发一个可以使用 MapFragment 或 SupportMapFragment 作为自定义控件的项目。 我尝试混合使用自定义控件(N-18) 和 Fraggle(N-26) 教程,但我无法使其工作。
我的自定义控件类:
public class CustomMapView : MvxFragment
{
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var ignored = base.OnCreateView(inflater, container, savedInstanceState);
return this.BindingInflate(Resource.Layout.CustomMapViewLayout, null);
}
}
我的 CustomMapViewLayout.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="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
在 FirstView.axml 中我引用了 CustomMapView:
<cc.CustomMapView
android:layout_width="match_parent"
android:layout_height="match_parent" />
(我在 Setup.cs 中使用 ViewNamespaceAbbreviations)
当我尝试部署时出现以下错误:
MvxBind:Error View Type Not Found - cc.CustomMapView(我确定命名空间是正确的) Android.Views.InflateException: 加载中...
有没有人设法解决了这种问题?
【问题讨论】:
标签: xamarin.android xamarin mvvmcross