【发布时间】:2016-01-18 19:58:56
【问题描述】:
我有一个来自 Cell 的 UICollectionView,它来自另一个带有缩放动画的 UIViewController。我必须用 UINavigationController 嵌入它,但是当它在模拟器中启动时,它不会显示 UINavigationController。问题是什么 ? 感谢帮助。
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
collectionView.deselectItemAtIndexPath(indexPath, animated: true)
let cell: PhotoCell = collectionView.cellForItemAtIndexPath(indexPath)as! PhotoCell
let detailViewController = storyboard?.instantiateViewControllerWithIdentifier("FullPhotoController") as! FullPhotoController
let attributes = collectionView.layoutAttributesForItemAtIndexPath(indexPath)
let attributesFrame = attributes?.frame
let frameToOpenFrom = collectionView.convertRect(attributesFrame!, toView: collectionView.superview)
transitionDelegate.openingFrame = frameToOpenFrom
let picture = everypicture[indexPath.row]
detailViewController.currentpicture = picture
detailViewController.transitioningDelegate = transitionDelegate
detailViewController.modalPresentationStyle = .Custom
presentViewController(detailViewController, animated: true, completion: nil)
}
【问题讨论】:
-
“FullPhotoController”是 UINavigationController 吗?如果不是,你只是在展示一个常规的模态控制器。
标签: ios swift uiviewcontroller uinavigationcontroller