Popover View是空白的

时间:2018-06-14 19:06:51

标签: ios swift popover

我正在尝试使用代码向我的控制器添加一个popover。出于某种原因,出现了弹出框,但内部没有内容。

enter image description here

我用于转换的代码是:

@IBAction func presentPopover(_ sender: UIButton) {
    //performSegueWithIdentifier("Popover", sender: self)
    let vc = PopoverViewController()
    vc.modalPresentationStyle = .popover
    let popover = vc.popoverPresentationController!
    popover.delegate = self
    popover.permittedArrowDirections = .right
    vc.popoverPresentationController?.sourceView = sender
    vc.popoverPresentationController?.sourceRect = sender.bounds
    ...
    present(vc, animated: true, completion: nil)
}

弹出窗口视图在故事板中制作,属于班级PopoverViewController。在进行一些测试后,它会说PopoverViewController's viewDidAppear已被触发。

enter image description here

1 个答案:

答案 0 :(得分:2)

as rmaddy提及行outer不使用故事板。所以你需要这样做

outer(x,x,`-`)

#     [,1] [,2] [,3] [,4] [,5] [,6]
#[1,]    0    4    2    0    2    3
#[2,]   -4    0   -2   -4   -2   -1
#[3,]   -2    2    0   -2    0    1
#[4,]    0    4    2    0    2    3
#[5,]   -2    2    0   -2    0    1
#[6,]   -3    1   -1   -3   -1    0