我正在使用 TextFieldEffects 在textField中添加文本输入效果。它显示一个错误

类型“UIView”没有成员“AnimationOptions”

这是代码。

override open func animateViewsForTextEntry() {
    borderLayer.frame.origin = CGPoint(x: 0, y: font!.lineHeight)

    UIView.animate(withDuration: 0.2, delay: 0.3, usingSpringWithDamping: 0.8, initialSpringVelocity: 1.0, options: UIView.AnimationOptions.beginFromCurrentState, animations: ({

        self.placeholderLabel.frame.origin = CGPoint(x: self.placeholderInsets.x, y: self.borderLayer.frame.origin.y - self.placeholderLabel.bounds.height)
        self.borderLayer.frame = self.rectForBorder(self.borderThickness, isFilled: true)

    }), completion: { _ in
        self.animationCompletionHandler?(.textEntry)
    })
}

override open func animateViewsForTextDisplay() {
    if text!.isEmpty {
        UIView.animate(withDuration: 0.35, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 2.0, options: UIView.AnimationOptions.beginFromCurrentState, animations: ({
            self.layoutPlaceholderInTextRect()
            self.placeholderLabel.alpha = 1
        }), completion: { _ in
            self.animationCompletionHandler?(.textDisplay)
        })

        borderLayer.frame = rectForBorder(borderThickness, isFilled: false)
    }
}

这是该错误的屏幕截图。
ios - iOS-类型“UIView”没有成员“AnimationOptions”-LMLPHP

如何解决这个问题?

最佳答案

至少在Xcode UIViewAnimationOptions.beginFromCurrentState。

关于ios - iOS-类型“UIView”没有成员“AnimationOptions”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52559361/

10-10 20:57