Slider.Scroller

此项为 API 级别 XE22 中的新增配置

指明固定集合内的当前位置的滚动滑块。 滑块会在处于非活动状态一段时间后自动隐藏。

用法示例:

 Scroller slider = Slider.from(view).startScroller(10, 0);
 ....
   slider.setPosition(p);  // slide through p in [0,10]
 ....
 

公共方法
abstract int
getMax()
抽象 浮点数
抽象 无效
hide()
抽象 无效
setPosition(浮点位置)
抽象 无效
show()

公共方法

在 API 级别 XE22 中添加

public abstract int getMax ()

返回位置的最大值。

在 API 级别 XE22 中添加

public abstract float getPosition ()

返回当前位置。

在 API 级别 XE22 中添加

public abstract void hide ()

隐藏滑块(如果尚未隐藏)。

在 API 级别 XE22 中添加

public abstract void setPosition (float position)

设置位置,通常在 0 和 getMax() 范围内。将滑块移回视图(如果隐藏的话)。超出此范围的值(即位置 < 0 或位置 > getMax())可用于实现拖动效果。

在 API 级别 XE22 中添加

public abstract void show ()

显示滑块(如果尚未显示的话)。该滑块会在闲置一段时间后自动隐藏。