你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
搜索问题、话题或人...
输入关键字进行搜索
搜索:
问题
精选文章
开源项目
视频教程
活动
· · ·
帮助
登录
注册
环信_iOS
ios 导航栏问题
在demo的基础上改界面需求,发现申请前与通知返回按钮不见了,我看了代码有设置,但不起作用,找不出原因
没有找到相关结果
已邀请:
与内容相关的链接
提交
7 个回复
donghai
赞同来自:
不轻易言弃
您把相关代码发上来一下,一般这种情况,是UI出现的问题!
donghai
UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
[backButton setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
[self.navigationItem setLeftBarButtonItem:backItem];
这是设置导航栏上返回按钮的代码,您仔细检查一下,是否出现错误
不轻易言弃
是啊,是这样设置的
donghai
您的工程中[UIImage imageNamed:@"back.png"] 有back.png这张图片吗? 您点击左上角的时候,是不是也可以跳转页面呢?
不轻易言弃
我注释掉导航栏的代码,点击左边区域也能返回的,
不轻易言弃
// Uncomment the following line to preserve selection between presentations.
self.title = NSLocalizedString(@"title.apply", @"Application and notification");
self.tableView.tableFooterView = [[UIView alloc] init];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
[backButton setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
[backButton addTarget:self.navigationController action:@selector(popViewControllerAnimated:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
[self.navigationItem setLeftBarButtonItem:backItem];
[self loadDataSourceFromLocalDB];
donghai
addTarget:self.navigationController 改成addTarget:self 试一试
要回复问题请先
登录
或
注册
发起人
不轻易言弃
问题状态
最新活动:
2015-08-06 10:41
浏览:
4557
关注:
2
人
7 个回复
donghai
赞同来自: 不轻易言弃
donghai
[backButton setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
[backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
[self.navigationItem setLeftBarButtonItem:backItem];
这是设置导航栏上返回按钮的代码,您仔细检查一下,是否出现错误
不轻易言弃
donghai
不轻易言弃
不轻易言弃
self.title = NSLocalizedString(@"title.apply", @"Application and notification");
self.tableView.tableFooterView = [[UIView alloc] init];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
UIButton *backButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 20, 20)];
[backButton setImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
[backButton addTarget:self.navigationController action:@selector(popViewControllerAnimated:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
[self.navigationItem setLeftBarButtonItem:backItem];
[self loadDataSourceFromLocalDB];
donghai