我正在尝试为我的xamarin.ios应用程序翻译此代码:
https://github.com/yourtion/YXWaveView/blob/master/YXWaveView/YXWaveView.swift
在线179:let path = CGMutablePath()
我在Xamarin找不到CGMutablePath
最佳答案
objcCGMutablePathRef
结构(或swift cgmutablepath类)由Xamarin.iOS
包装为CGPath
(CoreGraphics
命名空间)。
var path = new CGPath();
Xamarin Macios/SRC/Coregraphics/cgpath.cs公司
public class CGPath : INativeObject, IDisposable {
internal IntPtr handle;
[DllImport (Constants.CoreGraphicsLibrary)]
extern static /* CGMutablePathRef */ IntPtr CGPathCreateMutable ();
public CGPath ()
{
handle = CGPathCreateMutable ();
}
[Mac(10,7)][iOS (5,0)]
public CGPath (CGPath reference, CGAffineTransform transform)
{
if (reference == null)
throw new ArgumentNullException ("reference");
handle = CGPathCreateMutableCopyByTransformingPath (reference.Handle, ref transform);
}
[DllImport (Constants.CoreGraphicsLibrary)]
extern static /* CGMutablePathRef */ IntPtr CGPathCreateMutableCopy (/* CGPathRef */ IntPtr path);
public CGPath (CGPath basePath)
{
if (basePath == null)
throw new ArgumentNullException ("basePath");
handle = CGPathCreateMutableCopy (basePath.handle);
}
~~~~~
关于swift - Xamarin中的CGMutablePath,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/47416510/