2012-09-05 81 views
0

我有一个名为'Sunset'的单元格的UITableView。按下UITableViewCell后,视图切换到“infoView”,它从.txt文件加载一些文本。当按下“后退”按钮时,视图切换回UITableView,但是存在问题。加载视图后,UITabBar不见了!既然它消失了,就不可能回到另一种观点。UITabBar在选择UITableViewCell时消失

我曾尝试:

self.hidesBottomBarWhenPushed = NO; 

代码:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    [tableView deselectRowAtIndexPath:indexPath animated:YES]; 
    UITableViewCell *cellSelected = [tableView cellForRowAtIndexPath:indexPath]; 
    NSString *cellTitle = cellSelected.textLabel.text; 

    if (cellTitle == @"Sunrise") 
    { //Swap views 
     informationView *iv = [[informationView alloc] initWithNibName:nil bundle:nil]; 
     [self presentModalViewController:iv animated:YES]; 
    } 
} 
+0

让我们来看看在didSelectRowAtIndexPath方法的代码,并在其中创建您的tableView –

+0

随时修改你原来的问题增添日e代码,而不是添加评论... –

回答

0

当然标签栏不显示。您正在以模态方式呈现第二个视图。如果你想保持这个实现,你将不得不增加对第二视图按钮或东西,将执行

[self.navigationController dismissModalViewControllerAnimated:YES]; //Programatically dismiss the view controller 

如果你想保留的TabBar和导航栏的功能,你应该使用

[self.navigationController pushViewController:iv animated:YES]; 

代替

[self presentModalViewController:iv animated:YES]; 
相关问题