How do I add an observer for when a UITabBar is hidden (through 'hides-bottom-bar-when-pushed')? I have a custom button that sits underneath my tab bar and I want to make sure it doesn't appear when the UITabBar is hidden. Thanks!
Try using the UINavigationControllerDelegate protocol:
- (void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
if (viewController.hidesBottomBarWhenPushed) {
// ...
}
}
The best option is to place your UIToolbar inside a UIView that has clipping enabled and position the clip-view just above the UITabBar. Then add this UIView as a subview of your UITabBar. This way showing and hiding the UITabBar will automatically show or hide your UIToolbar Now you can animate the showing and hiding of your UIToolbar and still have it disappear each time the UITabBar does.
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