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.
我已经通过界面构建器在超级视图中启用了自动调整子视图。有没有办法以编程方式禁用一个子视图视图的自动调整大小?
我假设您确实在使用自动调整大小,而不是自动布局。
将该子视图设置autoresizingMask为UIViewAutoresizingNone以使其父视图在自动调整大小期间忽略它。
autoresizingMask
UIViewAutoresizingNone