Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道 CGRect 由 4 个浮点数组成。如何从给定的 CGRect 对象中获取这些浮点数?
我搜索了 CGRect 的类参考,但一无所获。
像这样:(假设之前定义了一个CGRect叫myRect)
CGRect
myRect
CGFloat x = myRect.origin.x; CGFloat y = myRect.origin.y; CGFloat height = myRect.size.height; CGFloat width = myRect.size.width;
你没有找到任何东西的原因是简单的 CGRect 不是一个类。
文档就在这里。
我希望它有所帮助。:)