我有一个带有 tableFooterView 的 tableView。
在 viewDidload 上:
<UIView: 0x6c87a70; frame = (0 325; 320 3); autoresize = TM+BM; layer = <CALayer: 0x6c87aa0>>
<UIImageView: 0x6c87b60; frame = (31 0; 257 3); autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x6c87ba0>> - table_pull_refresh_footer.png
在 viewWillLayoutSubviews 上我看到的是
<UIView: 0x6c87a70; frame = (0 325; 320 3); autoresize = TM+BM; layer = <CALayer: 0x6c87aa0>>
<UIImageView: 0x6c87b60; frame = (31 0; 320 3); autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x6c87ba0>> - table_pull_refresh_footer.png
那么为什么UIImageView突然变大了呢? parentView 根本不会改变大小。还是 320 3。
最佳答案
问题正如vikingosgundo所说。
我应该先调用[super viewWillLayoutSubviews]
关于ios - 为什么这个 View 会神奇地改变大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15720908/