语言

VelocityTracker.ComputeCurrentVelocity 方法

定义

重载

名称 说明
ComputeCurrentVelocity(Int32)

等效于使用 Float 的最大速度调用 #computeCurrentVelocity(int, float) 。

ComputeCurrentVelocity(Int32, Single)

根据收集的点计算当前速度。

ComputeCurrentVelocity(Int32)

等效于使用 Float 的最大速度调用 #computeCurrentVelocity(int, float) 。

[Android.Runtime.Register("computeCurrentVelocity", "(I)V", "")]
public void ComputeCurrentVelocity(int units);
[<Android.Runtime.Register("computeCurrentVelocity", "(I)V", "")>]
member this.ComputeCurrentVelocity : int -> unit

参数

units
Int32

用于单位的 System.Int32 值。

属性

注解

等效于 #computeCurrentVelocity(int, float) 调用最大速度为 Float.MAX_VALUE。

Java文档android.view.VelocityTracker.computeCurrentVelocity(int)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

另请参阅

  • <xref:Android.Views.VelocityTracker.ComputeCurrentVelocity(System.Int32%2c+System.Single)>

适用于

ComputeCurrentVelocity(Int32, Single)

根据收集的点计算当前速度。

[Android.Runtime.Register("computeCurrentVelocity", "(IF)V", "")]
public void ComputeCurrentVelocity(int units, float maxVelocity);
[<Android.Runtime.Register("computeCurrentVelocity", "(IF)V", "")>]
member this.ComputeCurrentVelocity : int * single -> unit

参数

units
Int32

你希望其速度的单位。 值为 1 提供单位/毫秒,1000 提供每秒单位,等等。请注意,此处提到的单位与报告运动的单位相同。 对于轴 X 和 Y,单位为像素。

maxVelocity
Single

此方法可计算的最大速度。 此值必须在与 units 参数相同的单元中声明。 该值必须是正数。

属性

注解

根据收集的点计算当前速度。 仅当实际想要检索速度信息时,才调用它,因为它相对昂贵。 然后,可以使用和 #getXVelocity(). 检索速度#getYVelocity()。

Java文档android.view.VelocityTracker.computeCurrentVelocity(int, float)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于