【发布时间】:2015-03-19 22:20:21
【问题描述】:
我在按钮单击时出现了一个弹出框,但它没有动画。我希望它从零大小开始,并成长为类似于 facebooks 在帖子上的胡萝卜动作的正确大小。非常感谢任何帮助。代码如下:
@IBAction func button(sender: AnyObject) {
let popover = PopoverController()
popover.modalPresentationStyle = .Popover
popover.preferredContentSize = CGSizeMake(UIScreen.mainScreen().bounds.width, 100)
let popoverPresentationController = popover.popoverPresentationController
popoverPresentationController?.permittedArrowDirections = UIPopoverArrowDirection.Up
popoverPresentationController?.delegate = self
popoverPresentationController?.sourceView = sender as UIView
popoverPresentationController?.sourceRect = sender.bounds
self.presentViewController(popover, animated: true, completion: nil)
}
func adaptivePresentationStyleForPresentationController(controller: UIPresentationController!) -> UIModalPresentationStyle {
return UIModalPresentationStyle.None
}
【问题讨论】:
标签: ios swift uipopovercontroller popover