[英]View is presented modally instead of Show
所以我有一個TableViewController。 showEpisodes
單元格后,將showEpisodes
segue。 此設置被設置為Show
並指向導航控制器,如下所示:
問題是我的視圖以模態顯示,即它沒有導航控制器。
這是我在主表視圖控制器中使用的代碼
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
let cell = tableView.cellForRowAtIndexPath(indexPath)
self.performSegueWithIdentifier("showEpisodes", sender: cell?.textLabel?.text)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showEpisodes" {
let viewController = segue.destinationViewController as! UINavigationController
let vc = viewController.topViewController as! EpisodesTableViewCOntroller
let indexPath: NSIndexPath = self.tableView.indexPathForSelectedRow!
let object: PFObject = self.objectAtIndexPath(indexPath)!
vc.podcast = object
// self.navigationController!.pushViewController(vc, animated: true)
}
}
如果我取消注釋self.navigationController!.pushViewController(vc, animated: true)
部分,則視圖將被很好地推送,但是一旦加載,就會在其上模態顯示一個黑色窗口。 我已經在調試器中檢查了UI層次結構,但沒有成功。 有什么想法嗎?
當前使用模式轉換的原因是因為您正從一個導航控制器轉到另一個導航控制器。 更改導航控制器時,以標准方式顯示“顯示”序列。 要使用推送動畫進行過渡,您需要將要過渡到的tableViewController移出導航控制器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.