2015-02-10 30 views

回答

1

對於UICollectionViewController在轉換之後對設置視圖的幀很重要。以某種方式UITableViewController自動設置。

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { 

     let src = segue.sourceViewController as UIViewController 
     let dst = segue.destinationViewController as UIViewController 

     addChildViewController(dst) 
     view.addSubview(dst.view) 
     dst.didMoveToParentViewController(self) 
     dst.view.frame = self.view.bounds //<-- this line is important for collection view 
    } 
1

你也許制約的利潤率? Dubbelclick您的約束,並檢查'​​相對於保證金'也許被檢查(在第一/第二項下拉菜單中)。如果是這樣,取消選中它。

將來您可以通過使用| - [] - | |菜單,並在添加約束之前取消選中「約束邊距」。

0
self.automaticallyAdjustsScrollViewInsets = NO; 
+1

你的答案當然是值得多一點的解釋。 – 2016-08-30 07:58:59

+0

我有同樣的問題,上面的解決方案適用於我,並感謝您的提示! @ J.Chomel – ita9178 2016-08-30 08:28:57

相關問題