简体   繁体   English

我可以使用Xamarin.Forms绘制多边形吗?

[英]Can I draw a polygon with Xamarin.Forms?

I'm having some problems finding any good documentation, so I thinking its not possible... but is there a way to draw a polygon with Xamarin.Forms? 我在寻找任何好的文档时遇到了一些问题,因此我认为不可能...但是有没有办法用Xamarin.Forms绘制多边形?

Xamarin.Forms.View seems not to have the same implementation as Android.Views.View :( Xamarin.Forms.View似乎没有与Android.Views.View相同的实现:(

Unfortunately not using the in-built views; 不幸的是不使用内置视图; the most sophisticated shape XF natively supports right now is a box. XF本机目前支持的最复杂的形状是一个盒子。 However, a custom view with native renderers for your target platforms could. 但是,可以使用针对目标平台的本机渲染器的自定义视图。

At best you can start a native activity and then use standard android paradigms 充其量您可以启动本机活动,然后使用标准的android范例

To start, call the following from your XF view model (or view): global::Xamarin.Forms.Forms.Context.StartActivity (typeof(MyNativeActivity)); 首先,从您的XF视图模型(或视图)中调用以下代码:global :: Xamarin.Forms.Forms.Context.StartActivity(typeof(MyNativeActivity));

Where MyNativeActivity is your native activity that draws on the screen. MyNativeActivity是您在屏幕上绘制的本机活动。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM