OGeek|极客世界-中国程序员成长平台

标题: ios - Xamarin 中的 CGPointFromString [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 18:11
标题: ios - Xamarin 中的 CGPointFromString

在 Xamarin.iOS 中是否有可用的等效函数 CGPointFromString

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



Best Answer-推荐答案


在 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/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4