Heim > Fragen und Antworten > Hauptteil
导航栏切换时出现bug。重现方式:在app里点来点去,可能会出现。
当出现该bug时,从首页进入任何带导航栏的页面都会出现此问题。
//项目中使用了下面这个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源码链接
仅有的幸福2017-05-02 09:31:07
你好 请问你的问题解决了吗?我也遇到了类似的问题。请示你是不是隐藏导航栏然后自定义了?我是因为这样操作而导致的。我还不知道怎么优化呢?请问你是怎么处理得呢?