【问题标题】:iOS 6.1 and Xcode 4.6, enumaration warning UIViewAnimationCurveEaseOutiOS 6.1 和 Xcode 4.6,枚举警告 UIView Animation Curve EaseOut
【发布时间】:2013-01-14 22:37:15
【问题描述】:

我已经安装了新的 iOS 6.1 和 Xcode 4.6,现在我的代码中有一些枚举警告,我无法解决这个问题:

[UIView animateWithDuration:0.4
                          delay:0.0
                        options:UIViewAnimationCurveEaseOut
                     animations:^{

                     } completion:^(BOOL finished) {}];

这是警告:

Implicit conversion from enumeration type 'enum UIViewAnimationCurve' to different enumeration type 'UIViewAnimationOptions' (aka 'enum UIViewAnimationOptions')

我该如何解决这个警告?

【问题讨论】:

    标签: iphone ios enums xcode4.6


    【解决方案1】:

    您使用了错误的选项值。试试UIViewAnimationOptionCurveEaseOut

    【讨论】:

    • 在阅读本 RW 教程时遇到了同样的问题:raywenderlich.com/2454/how-to-use-uiview-animation-tutorial 感谢 Kevin Ballard!
    • 关于添加 UIViewAnimationOptionCurveEaseOut 出现错误“使用未声明的标识符 'animationOptions'”
    • @Naresh 确保您在选项之前传递延迟:0.0f 参数:参数。因此它是 animateWithDuration: delay: options: animations: completion:
    【解决方案2】:

    UIViewAnimationCurveEaseOut 替换为UIViewAnimationOptionCurveEaseOut

    例如:

    [UIView animateWithDuration:0.4
                              delay:0.0
                            UIViewAnimationOptionCurveEaseOut
                         animations:^{
    
                         } completion:^(BOOL finished) {}];
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-07
      • 2023-03-09
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-15
      相关资源
      最近更新 更多