gpt4 book ai didi

ios - 从 CGRect 对象中获取数据

转载 作者:行者123 更新时间:2023-12-01 18:02:51 24 4
gpt4 key购买 nike

我知道 CGRect 由 4 个浮点数组成。如何从给定的 CGRect 对象中获取这些浮点数?

我搜索了 CGRect 的类引用,但一无所获。

最佳答案

像这样:(假设先前定义的 CGRect 称为 myRect )

CGFloat x = myRect.origin.x;
CGFloat y = myRect.origin.y;
CGFloat height = myRect.size.height;
CGFloat width = myRect.size.width;

关于ios - 从 CGRect 对象中获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6280255/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com