Xamarin 类型或命名空间名称';图形';命名空间中不存在';Project.Android';
我正在开发一个Xamarin.Forms应用程序,其中我添加了一个自定义渲染器来设置本机编辑文本的背景。下面的代码显示错误。Xamarin 类型或命名空间名称';图形';命名空间中不存在';Project.Android';,xamarin,xamarin.forms,custom-renderer,Xamarin,Xamarin.forms,Custom Renderer,我正在开发一个Xamarin.Forms应用程序,其中我添加了一个自定义渲染器来设置本机编辑文本的背景。下面的代码显示错误。 var shape=newshapedrawable(newandroid.Graphics.Drawables.Shapes.RectShape())问题在于,您的应用程序使用名称空间Project.Android,类型系统将认为Android.graphics.Drawables.Shapes.RectShape属于Project.Android 您可以选择: 更改项
var shape=newshapedrawable(newandroid.Graphics.Drawables.Shapes.RectShape())
问题在于,您的应用程序使用名称空间Project.Android
,类型系统将认为Android.graphics.Drawables.Shapes.RectShape
属于Project.Android
您可以选择:
Android.Graphics.Drawables.Shapes.RectShape
与global::
类似:global::Android.Graphics.Drawables.Shapes.RectShape
RectShape
的来源:using RectShape=Android.Graphics.Drawables.Shapes.RectShape
,只需使用new RectShape()
问题是您的应用程序使用名称空间
Project.Android
,类型系统会认为Android.graphics.Drawables.Shapes.RectShape
属于Project.Android
您可以选择:
Android.Graphics.Drawables.Shapes.RectShape
与global::
类似:global::Android.Graphics.Drawables.Shapes.RectShape
RectShape
的来源:using RectShape=Android.Graphics.Drawables.Shapes.RectShape
,只需使用new RectShape()