I am using autolayout in my project and I have a tableview in my view controller. So I have set its vertical spacing from the bottom of top layout guide and from the top of bottom layout guide to be 0. but when I hide the tab bar, the tableView does not extend to the bottom of the screen. Does this mean that iOS does not adjust the bottom layout guide when tab bar is hidden?
The answer to your question is no, the bottom layout guide is not changed when you hide the bar.
Why? Simply because the tab bar is not removed from its superview, it's just hidden and thus the bottom layout guide shouldn't change. What would happen if you were to show it back again?
(lldb) po [[[self tabBarController] tabBar] isHidden]
0x0000000000000001
(lldb) po [[self tabBarController] tabBar]
<UITabBar: 0x14dd3f890; frame = (0 519; 320 49); hidden = YES; autoresize = W+TM; userInteractionEnabled = NO; layer = <CALayer: 0x17022c760>>
As you can see, the bar is still 'there', it hasn't been removed from the hierarchy and as a consequence, the bottom layout guide doesn't change. This is expected behaviour.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With