我将 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
警告。我试图self
用self.navigationController
or替换,self.parentViewController.navigationController
但两者都不起作用。
有没有人使用这个库解决这个问题或知道解决方案?