[英]Load View controller in xib file
我想知道是否可以在Xib文件的這兩個視圖之間進行某種區分。
主視圖將加載到情節提要中的滾動視圖中。 。
(因此,如果我點擊Bewerken(edit),我將被推送到右側的視圖控制器)
謝謝!
我建議將其更改為情節提要中的容器視圖,而不是單獨的Xib。 您可以添加UIContainerView並將其定位/調整為子視圖,並添加“ Storyboard Embed Segue來附加另一個ViewController。這就是IB / Storyboard中的樣子:
在運行時,藍色的UIView(或嵌入式UIViewController,如果需要的話)將作為子視圖嵌入到托管UIView中:
如果您將實現更改為此,則您將身處美麗的segue世界中,只需拖放即可:)
您可以做兩件事:
1-在導航控制器中包裝主視圖,因此您可以執行以下操作:
@IBAction func loadEditController(sender:UIButton){
let editController = RegisterController(nibName:"RegisterXIB", bundle:nil)
navigationController?.pushViewController(editController, animated: true)
}
2-在當前上下文中呈現“編輯控制器”並自己設置動畫
@IBAction func loadEditController(sender:UIButton){
let editController = RegisterController(nibName:"RegisterXIB", bundle:nil)
editController.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
presentViewController(editController, animated: false, completion: nil)
//Move it offscreen and the animate it here
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.