0

我将 SLPagingView ( https://github.com/StefanLage/SLPagingView/ ) 开源库用于基于分页视图的应用程序,例如 Twitter 或 Tinder。从某个页面我打开一个详细视图。当我回来时,分页视图的布局被破坏了。

细节视图控制器.m

- (void)backButtonPressed {
    [self dismissViewControllerAnimated:YES completion:nil];
}

事实上,我注意到应用程序的层次结构在 DetailView 出现之前就被破坏了。

SomePageViewController.m

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Perform segue to detailView
      [self performSegueWithIdentifier:@"actionDetail" sender:nil];

   /* Does not work with a modal view controller either
 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main"bundle:nil];
    DetailViewController *detailViewController =
(DetailViewController *)
    [storyboard instantiateViewControllerWithIdentifier:@"detailcontroller_id"];
[self pushViewController:detailViewController animated:YES];*/
}

我收到了Presenting view controllers on detached view controllers is discouraged警告。我试图selfself.navigationControlleror替换,self.parentViewController.navigationController但两者都不起作用。

有没有人使用这个库解决这个问题或知道解决方案?

4

1 回答 1

0

固定的。我修改了 SLPagingView 库。添加[self addChildViewController:ctr],initWithNavBarControllers:initWithNavBarItem:其他生命周期方法。检查差异:https ://www.diffchecker.com/cnlvslym

于 2015-08-04T15:58:44.067 回答