【发布时间】:2016-06-07 20:30:07
【问题描述】:
这是目前的情况:
UITabBarController
UINavigationController
UIPageViewController
Some UIViewControllers (the actual content)
所以 UIPageViewController 包含一些 UIViewControllers,它们都包含一个 UITableView。
当我单击 UITableView 中的某一行时,UIViewController 会调用 didSelect 方法。该方法如下所示:
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
tableView.deselectRowAtIndexPath(indexPath, animated: true)
let activity = self.activities[indexPath.row - 1]
self.delegate?.dayTableViewSelectedActivity(activity, sender: self)
}
然后 UIPageViewController 已经实现了协议,因此正在调用委托方法。该方法如下所示:
func dayTableViewSelectedActivity(activity: Activity, sender: DayTableViewController) {
self.performSegueWithIdentifier("openDetails", sender: activity)
}
然后应用导航(推送)到 DetailViewController。当我向后滑动(默认 iOS 行为)时,DetailViewController 立即弹出到 UIPageViewController,没有动画。然后我的导航栏坏了,并且包含一个不属于那里的后退按钮,因为我无法再返回了。
当我再次单击一个单元格时,控制台会给我一个nested push animation can result in corrupted navigation bar 消息。我从那里采取的每一个操作都会给我带来更多控制台错误,例如:
nested pop animation can result in corrupted navigation bar
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
这个错误让我沮丧了好几个小时,我不知道我做错了什么。没有双重选择。我检查了很多次。希望大家能帮帮我。
【问题讨论】:
标签: ios swift uinavigationcontroller uipageviewcontroller