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.
我在情节提要中有一个徽标设置为值 28 的顶部约束,它适用于所有设备。在 iPhone X 设备上,它与顶部的相机栏合并。如果我增加顶部约束,它会影响其他设备。如何仅针对 iPhone X 设置约束?
默认情况下,Xcode 为您提供了一个Safe Area项目创建时。
Safe Area
在这里,我添加了UIView具有以下约束的 a。请注意约束是如何固定到 的Safe Area,而不是Superview.
UIView
Superview
运行应用程序,您会看到视图尊重所有设备的状态栏。
希望这对您遇到的问题有所帮助...