我正在为主详细信息页面编写自定义渲染器。我在主要活动中遇到了无效的强制转换异常。
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
{
protected override void OnCreate(Bundle bundle)
{
//TabLayoutResource = Resource.Layout.Tabbar;
//ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(bundle);
global::Xamarin.Forms.Forms.Init(this, bundle);
LoadApplication(new App());
}
}
[assembly: ExportRenderer(typeof(Xamarin.Forms.MasterDetailPage), typeof(CustomRenderer))]
namespace App3.Droid.Renderer
{
public class CustomRenderer : MasterDetailPageRenderer
{
public CustomRenderer(Context context) : base(context)
{
}
}
}