加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – 后退按钮不会出现在推送的UIViewController上

发布时间:2020-12-16 06:01:42 所属栏目:百科 来源:网络整理
导读:我有一个UITableViewController.当我点击一个单元格,我想推一个新的视图.这样做不错,但新视图没有后退按钮.为什么是这样? TableViewCode: if([[NSUserDefaults standardUserDefaults] boolForKey:@"isLoggedIn"]) { UITableViewCell *cell = [tableView ce
我有一个UITableViewController.当我点击一个单元格,我想推一个新的视图.这样做不错,但新视图没有后退按钮.为什么是这样?

TableViewCode:

if([[NSUserDefaults standardUserDefaults] boolForKey:@"isLoggedIn"])
                {
                    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
                    ProfileViewController* profileViewController = [[ProfileViewController alloc] initWithNibName:@"ProfileViewController" bundle:nil];
                    profileViewController.message = [NSDictionary dictionaryWithObjectsAndKeys:cell.textLabel.text,@"user_login",@"default",@"message_source",nil];
                    switch(indexPath.row) {
                        case kUsernameRow:                  
                            [self.navigationController pushViewController:profileViewController animated:YES];
                            [profileViewController release];
                            break;
                        case kAboutRow:                 
                            break;
                        case kTOSRow:                   
                            break;
                    }
                }

解决方法

如果你的表视图控制器是从nib创建的,它的默认标题是@“”(注意:不是nil,而是一个空字符串).

返回按钮有一个错误,如果导航堆栈上的前一个控制器的标题是空字符串,则不显示,因此在表视图控制器中,您需要将标题设置为无效或代码中的某些字符串,或接口中的某些字符串生成器(不能设置为无).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读