我正在尝试创建与此类似但不在导航控制器中的内容,而是在按下时按下按钮:
只要它们是可点击的,它就可以是桌面视图或按钮。我知道我需要有两个viewcontrollers通过“present as popover”segue连接,并将锚点连接到按钮。这是我目前的popover视图代码,它可以工作,但我不知道如何在里面添加可滚动,可点击的项目。
class ViewController: UIViewController, UIPopoverPresentationControllerDelegate{
@IBAction func popOverButtonPressed(sender: AnyObject) {
self.performSegueWithIdentifier("showPop", sender: self)
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "showPop" {
var vc = segue.destinationViewController
var controller = vc.popoverPresentationController
if controller != nil {
controller?.delegate = self
}
}
}
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController) -> UIModalPresentationStyle {
return.None
}
}