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.
我想以编程方式更改约束,具体取决于应用程序是在带有主页按钮的旧 iPad Pro 上运行,还是在带有主页栏(滑动指示器)的新 iPad Pro(第三代 iPad Pro)上运行。我如何在 Swift 中做出这种区分,因为它们都具有相同的屏幕尺寸 - 12.9 英寸。是否有一些内置标志?
我通过使用扩展 UIDevice 在这里找到了答案: https ://stackoverflow.com/a/26962452/6217970