I have an ipad app where i would like to hide and show a category list (kind of like the small view in a split view controller), and the main view which contains a UiNavigationController stack.
I would like to resize the UINavigationController view to fill the whole screen when the category list is hidden, and to shrink when i show the list.
I have it working, except the title of the navigation bar immediately jumps to its new offset when setting the frame within an animation begin/commit block.
Any ideas how to stop the jump of the title?
I used this for fixing those jumps in UINavigationBar for title and right button.
#import "UINavigationBar+My.h"
@implementation UINavigationBar (My)
- (void)layoutSubviews {
for (id obj in [self subviews]) {
if ([NSStringFromClass([obj class]) isEqualToString:@"UINavigationItemView"])
[(UIView *)obj setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin];
else if ([NSStringFromClass([obj class]) isEqualToString:@"UIButton"]) {
if ([(UIButton *)obj center].x < ([self center].x / 2))
[(UIButton *)obj setAutoresizingMask:UIViewAutoresizingFlexibleRightMargin];
else
[(UIButton *)obj setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
}
}
@end
I hope it will help you ;-)
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