Share via


UIView.InheritedAnimationDuration 属性

定义

静态方法,返回当前活动动画的持续时间(以秒为单位)。

[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static double InheritedAnimationDuration { [Foundation.Export("inheritedAnimationDuration")] [ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.InheritedAnimationDuration : double

属性值

默认值为 0。

属性

注解

此属性显示当前活动动画的持续时间。

UIView.Animate(2.0, () => {
    //...Animation
    var inheritedDuration = UIView.InheritedAnimationDuration;
    // inheritedDuration == 2.0
});
var defaultDuration = UIView.InheritedAnimationDuration;
// defaultDuration == 0.0

适用于