【问题标题】:Adding two UIViewAnimationOptions to an animation (Swift)向动画添加两个 UIViewAnimationOptions (Swift)
【发布时间】:2015-12-24 07:55:57
【问题描述】:

我有这个表格动画的代码:

    UIView.animateWithDuration(0.33, delay: 0, options: UIViewAnimationOptions.CurveEaseOut | UIViewAnimationOptions.AllowUserInteraction, animations: { () -> Void in

    self.myTableView.setContentOffset(CGPoint(x: 0, y: offSetY), animated: false)


    }, completion: nil)

我想要额外的选项UIViewAnimationOptions.AllowUserInteraction,但我收到错误:“| 不能应用于两个 UIViewAnimationOptions 操作数”。我怎样才能添加这个?在 Objective-c 中工作。

【问题讨论】:

标签: ios swift uiviewanimation


【解决方案1】:

Swift 2 你必须这样写。 OptionSetType 具有更新的语法。

UIView.animateWithDuration(0.33, delay: 0, options:[UIViewAnimationOptions.CurveEaseOut, UIViewAnimationOptions.AllowUserInteraction], animations: { () -> Void in

        self.myTableView.setContentOffset(CGPoint(x: 0, y: 8), animated: false)


        }, completion: nil)

【讨论】:

  • 啊,在数组中得到它,谢谢!给我一分钟,我会接受你的回答
猜你喜欢
  • 2017-01-31
  • 2013-05-24
  • 1970-01-01
  • 2016-06-08
  • 1970-01-01
  • 1970-01-01
  • 2017-04-07
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多