gpt4 book ai didi

iphone - UIView 自动调整资源大小

转载 作者:行者123 更新时间:2023-12-03 18:19:45 24 4
gpt4 key购买 nike

我一直致力于自动调整自定义 UIView 的大小,Apple 对此几乎没有什么可说的。更重要的是,根据SO反馈,苹果的文档在某些方面实际上是错误的。最后,尽管 Interface Builder 中有六个调整大小组件,setAutoresizingMask: 有六个调整大小组件,但它们似乎根本不相关。例如,在旋转设备时,在 IB 中设置宽度 Spring 与将 autoresizingMask 设置为 UIViewAutoresizingFlexibleWidth 具有不同的效果。

是否有任何好的资源可以帮助您了解 iPhone 上如何调整大小?

编辑:

我了解 Apple 使用的基本概念,例如 contentMode,并且我已通读 UIView 文档。我正在寻找一些东西,可以更深入地解释 IB 设置在 SDK 中以编程方式提供的功能方面的作用。

最佳答案

autoresizingMask设置为UIViewAutoresizingFlexibleWidth,相当于设置宽度 Spring ,加上Interface Builder中的左右支柱(支柱意味着边缘是< em>不灵活)。如果您想复制仅设置宽度 Spring 而不设置左右支柱的行为,则必须将 autoresizingMask 设置为 UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleLeftMargin UIViewAutoresizingFlexibleRightMargin

关于iphone - UIView 自动调整资源大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2128961/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com