xamarin MAUI(安卓)界面视图

jv4diomz  于 2022-12-07  发布在  其他
关注(0)|答案(1)|浏览(251)

我需要一个Android.Views.SurfaceView组件来绘制。
我放置了一个Microsoft.Maui.Controls.BoxView组件,然后尝试使用
var platformHandler = compname.Handler.PlatformView;,但我收到了Android.Views.View,它没有/关联我需要的Android.Views.Surface对象。
是否有任何包含SurfaceViewSurface“相关”对象的组件可以使用?
也许有一种方法可以从Android.Views.View中提取Surface对象?

iszxjhcz

iszxjhcz1#

Since .NET MAUI is a cross-platform framework for creating native mobile and desktop apps with C# and XAML, you can try to use Microsoft.Maui.Graphics to achieve this.
.NET Multi-platform App UI (.NET MAUI) graphics, in the Microsoft.Maui.Graphics namespace, enables you to draw graphical objects on a canvas that's defined as an ICanvas object.
The .NET MAUI GraphicsView control provides access to an ICanvas object, on which properties can be set and methods invoked to draw graphical objects. For more information about the GraphicsView , see GraphicsView .
For more information, please check: Draw graphical objects .
Besides, .NET MAUI graphics includes the ability to paint graphical objects with solid colors, gradients, repeating images, and patterns. The Paint class is an abstract class that paints an object with its output. Classes that derive from Paint describe different ways of painting an object.
For more information, please check: Paint graphical objects .

相关问题