gpt4 book ai didi

ios - "value of the frame property is undefined and should not be modified"的含义?

转载 作者:行者123 更新时间:2023-11-29 02:15:19 25 4
gpt4 key购买 nike

所以在 UIView 文档中你有:

However, if the transform property contains a non-identity transform, the value of the frame property is undefined and should not be modified. In that case, you can reposition the view using the center property and adjust the size using the bounds property instead.

很明显,在应用转换后,我不应该更改 frame 的值来重新定位或调整它的大小,但是 frame 中的值是否仍然有效并使感觉?即我仍然可以使用它们进行计算吗?

在我应用转换的 UIImageView 中,bounds 中的值根本没有改变,似乎反射(reflect)了 UIImageView< 的大小改造前。

最佳答案

文档非常清楚 -

the value of the frame property is undefined

因此,如果安装了非恒等式转换,则不能依赖 frame 属性来获得合理的值。

关于ios - "value of the frame property is undefined and should not be modified"的含义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28820774/

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