菜鸟教程小白 发表于 2022-12-11 18:11:32

ios - Xamarin 中的 CGPointFromString


                                            <p><p>在 Xamarin.iOS 中是否有可用的等效函数 <a href="https://developer.apple.com/reference/uikit/1624477-cgpointfromstring" rel="noreferrer noopener nofollow">CGPointFromString</a> </p>

<p>我查看了在线 Xamarin API 文档,但没有发现任何相关内容。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>在 Xamarin.iOS 中没有等效于 CGPointFromString 的任何内置方法。您可以使用以下方法从字符串中获取 CGPoint。</p>

<pre><code>      String str = &#34;{23,213}&#34;;
      str = str.Replace(&#39;{&#39;, &#39;&#39;);
      str = str.Replace(&#39;}&#39;, &#39;&#39;);

      string[] coord = str.Split(&#39;,&#39;);
      CoreGraphics.CGPoint pt = new CoreGraphics.CGPoint(Int64.Parse(coord), Int64.Parse(coord);
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - Xamarin 中的 CGPointFromString,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40880425/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40880425/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - Xamarin 中的 CGPointFromString