我在UILayoutGuide中遇到了一個非常奇怪的行爲。 bottomLayoutGuide.length在傳遞length屬性時返回0。_UILayoutGuide bottomLayoutGuide長度爲零
同時在控制檯打印bottomLayoutGuide返回以下結果:
<_UILayoutGuide: 0x9ad9c60; frame = (0 455; 0 0); hidden = YES; layer = <CALayer: 0x9ab8200>>
它明確指出UILayoutGuide的幀的長度是455
打印長度直接通過
p [((_UILayoutGuide*)self.bottomLayoutGuide) length]
返回
(float) $12 = 0