所以我在两个平台(iOS和Android)中都使用了这个兼容性渲染器,它有这个方法Platform.GetRenderer(view)
,但是在Maui的RC版本中,这个方法似乎已经被标记为过时了,有人知道这个新方法是什么吗?
var nativeView = Microsoft.Maui.Controls.Compatibility.Platform.iOS.
Platform.GetRenderer(view)?.NativeView;
var nativeView = Microsoft.Maui.Controls.Compatibility.Platform.Android.
Platform.GetRenderer(view)?.NativeView;
先谢了
1条答案
按热度按时间tvokkenx1#
如果我找到了正确的pull request,它们就会被废弃,因为:
目前,我们有一个
Handler
版本的Xamarin.Forms
中的所有传统渲染器,因此用户将获得最大的成功,只是使用Handlers
与使用Renderers
基于过时的消息,您应该改用
Use Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer
。