A bug occurs when switching the navigation bar. How to reproduce: Click here and there in the app and it may appear.
When this bug occurs, this problem will occur when entering any page with a navigation bar from the home page.
//项目中使用了下面这个category
#import "UINavigationController+FDFullscreenPopGesture.h"
//自定义首页导航栏的代码
//left item
UIButton *leftItem = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 40, 14)];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftItem];
//title view
UIImageView *titleImage = [[UIImageView alloc] initWithImage:IMAGE(@"乡味汇横版")];
self.navigationItem.titleView = titleImage;
//right item
UIImageView *rightItem = [[UIImageView alloc] initWithImage:IMAGE(@"消息")];
[rightItem addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showMessage)] ];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:rightItem];
//UINavigationController FDFullscreenPopGesture source code link
仅有的幸福2017-05-02 09:31:07
Hello, has your problem been solved? I also encountered a similar problem. Could you please tell me whether you hide the navigation bar and then customize it? This is what I did. I still don’t know how to optimize it? How did you handle it?