【问题标题】:How to animate a popover on iPhone, iOS 8如何在 iPhone、iOS 8 上为弹出框设置动画
【发布时间】: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


    【解决方案1】:

    你可以试试

    popoverPresentationController?.modalTransitionStyle = .crossDissolve 
    

    就在演示之前。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-08-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-27
      • 2013-05-31
      • 2014-02-02
      相关资源
      最近更新 更多