简体   繁体   English

带有用于Android的自定义渲染器的Xamarin.Forms会产生编译器错误

[英]Xamarin.Forms with custom renderer for Android yields compiler error

After upgrading to Xamarin.Forms 1.2.3 I'm getting the following compiler error related to the definition of a custom renderer: 升级到Xamarin.Forms 1.2.3后,我收到与自定义渲染器的定义有关的以下编译器错误:

Error CS0012: The type `Xamarin.Forms.Platform.Android.FormsViewGroup' is
defined in an assembly that is not referenced. Consider adding a reference to
assembly `FormsViewGroup, Version=1.2.3.0, Culture=neutral,
PublicKeyToken=null' (CS0012) (XFormsNavigation.Android)

What is wrong and how can I fix it? 有什么问题,我该如何解决?

Not sure, why you have to add a Xamarin.Forms library manually. 不确定,为什么必须手动添加Xamarin.Forms库。 But here's what to do: 但是,这是怎么做的:

In packages/Xamarin.Forms.1.2.3.6256-pre4/lib/MonoAndroid10/ (or similar depending on your Xamarin.Forms version) you'll find the library FormsViewGroup.dll . packages/Xamarin.Forms.1.2.3.6256-pre4/lib/MonoAndroid10/ (或类似的版本,具体取决于您的Xamarin.Forms版本)中,您将找到FormsViewGroup.dll库。 Add it to the references of your Android project and it should compile. 将其添加到您的Android项目的引用中,然后进行编译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Xamarin.Forms中的Droid Custom Picker Renderer错误 - Error with Droid Custom Picker Renderer in Xamarin.Forms Xamarin.Forms>列表>自定义渲染器 - Xamarin.Forms > List > Custom Renderer Xamarin.Forms 中 Picker 的自定义渲染器 - Custom Renderer for Picker in Xamarin.Forms 在自定义按钮渲染器 (Xamarin.Android) 中获取渲染的 class 按钮的实例(在 Xamarin.Forms 内) - Get instance of rendered class Button (inside Xamarin.Forms) inside custom button renderer (Xamarin.Android) android [Xamarin.Forms] 中用于唯一角半径值的自定义帧渲染器 - Custom Frame renderer for unique corner radius values in android [Xamarin.Forms] 将样式应用于Xamarin.Forms中的iOS自定义渲染器 - Applying a style to an iOS custom renderer in Xamarin.Forms 我想使用资源! (Xamarin.Forms的自定义渲染器) - I want to use Resource !! (Xamarin.Forms 's custom renderer) 如何在 Xamarin.Forms 中为 StackLayout 正确创建自定义渲染器? - How to correctly create a Custom Renderer for StackLayout in Xamarin.Forms? Xamarin.Forms 上的自定义渲染器可以找到 OnElementChanged 方法 - Custom renderer at Xamarin.Forms could find a OnElementChanged method 使用Xamarin.Forms自定义渲染器时转发事件/命令 - Forwarding events/commands when using Xamarin.Forms Custom Renderer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM