我正在尝试使用代码向我的控制器添加一个popover。出于某种原因,出现了弹出框,但内部没有内容。
我用于转换的代码是:
@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
已被触发。
答案 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