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.
我正在将我的一个 iPhone 应用程序移植到 mac,但我不知道如何在屏幕上移动我的 NSImageViews,就像我对 CGpointMake 所做的那样。另外,你如何在可可中找到 image.center.x?
任何帮助都会很棒!
这听起来像您正在搜索 CoreAnimation。
CALayers 是为你想要的东西而设计的。你可以在它们上面自由地指定它们的“anchorPoint”(它们的“中心”),这样你就可以决定它们的中心应该在左上角、中心还是其他地方。此外,它们是为动画之类的东西制作的。
从基于 UIView 的应用程序移植非常容易(我自己做过)。视图和层在很多方面都非常相似。