我正在研究一個項目,我可以在其中使用MapFragment或SupportMapFragment作爲自定義控件。 我試圖混合自定義控件(N-18)和Fraggle(N-26)教程,但我無法使其工作。作爲MvvmCross中的自定義控件的Android MapFragment
我的自定義控制類:
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" />
(I使用ViewNamespaceAbbreviations在Setup.cs)
當我嘗試部署我得到這些錯誤:
MvxBind:錯誤查看類型未找到 - cc.CustomMapView(我敢肯定的命名空間是正確的) Android.Views.InflateException:正在加載...
有沒有人設法解決這種問題?