ios - Xamarin 中的 CGPointFromString

标签 ios xamarin.ios cgpoint

Xamarin.iOS 中是否有适用于 CGPointFromString 的等效函数?

我查看了在线 Xamarin API 文档,但没有发现任何相关内容。

最佳答案

Xamarin.iOS 中没有任何与 CGPointFromString 等效的内置方法。您可以使用以下方法从字符串中获取 CGPoint。

        String str = "{23,213}";
        str = str.Replace('{', '');
        str = str.Replace('}', '');

        string[] coord = str.Split(',');
        CoreGraphics.CGPoint pt = new CoreGraphics.CGPoint(Int64.Parse(coord[0]), Int64.Parse(coord[1]);

关于ios - Xamarin 中的 CGPointFromString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40880425/

相关文章:

ios - IOS 中的错误存档

ios - 通过 paypal 汇款 (iOS paypal sdk)

ios - '无法将类型 'Int' 的值转换为预期参数类型 'CGPoint'

ios - UITextView 在使用 iOS 7 SDK 构建时换行文本

c# - 为什么 PresentViewControllerAsync 不阻塞?

ios - 将 Xamarin.Forms 应用程序部署到物理 iOS 设备时出现 "resource fork, Finder information, or similar detritus not allowed"错误

Xamarin.ios 错误 MSB6006 : "codesign" exited with code 1

iPhone SDK : How to make a label view a cgpoint?

swift - 获取 UIView/UIImageView 的特定角坐标,而不管其旋转

ios - 如何防止 iOS 中同一个 UIButton 发生多个事件?