如果您查看this image(我不想上传它,因为它不属于我),您将在设置中的主uiview控制器中看到似乎是uiview的内容iPad的应用程序。我的问题是,我如何以编程方式复制这个?换句话说,我如何将UIView嵌入另一个?
以下是我所知道和已经完成的事情:
这就是我需要的东西:
这是我到目前为止所拥有的:
@IBAction func buttonPressedSpawnSubview(sender: AnyObject) {
//Open a subview from Interface builder.
}
@IBAction func closeButtonPressedSpawnSubview(sender: AnyObject) {
//kill the subview.
有人可以帮我弄清楚如何填写注释行吗?
答案 0 :(得分:1)
你看到的是另一个视图之上的模态UIView。
可见ViewController中的一个示例是:
self.modalTransitionStyle = UIModalTransitionStyle.FlipHorizontal // Choose whatever transition you want
self.modalPresentationStyle = .CurrentContext // Display on top of current UIView
self.presentViewController(yourNewViewObject, animated: true, completion: nil)