Skip to content
ScrollBox

界面 / ScrollBox

ScrollBox Class

滑动框

Hierarchy

Table of contents

Accessors

allowOverscroll(isAllowOverscroll: boolean): void client
设置允许滚动超过滚动框大小
alwaysShowScrollBar(): boolean client
获取是否一直显示滚动条
animationType(): UIScrollBoxAnimationType client
获取动画类型
defaultLocation(): ScrollBarDefaultLocation client
返回滚动条的默认位置(类型,非具体坐标)
elasticMultiplier(): number client
获取弹性系数
onScrollEnd(): MulticastDelegate<() => void> client
滚动结束事件
onUserScrolled(): MulticastDelegate<(currentOffset: number) => void> client
滚动事件
orientation(): Orientation client
获取滚动方向
scrollAxisBrushDrawType(): Readonly<SlateBrushDrawType> client
获取滚动条图片绘制类型
scrollAxisBrushGuid(): string client
获取滚动条图片ID
scrollAxisBrushMargin(): Readonly<Margin> client
获取滚动条图片边距
scrollAxisColor(): Readonly<LinearColor> client
获取滚动条图片颜色
scrollBarVisibility(): SlateVisibility client
获取滚动条的显示于隐藏
scrollOffset(): number client
获取滚动框偏移
scrollOffsetFraction(): number client
获取滚动框距离底部的偏移比例
scrollOffsetOfEnd(): number client
获取滚动框距离底部的偏移
scrollWheelMultiplier(inScrollWheelMultiplier: number): void client
设置鼠标滚轮系数
scrollbarPadding(inScrollbarPadding: Margin): void client
设置滚动条边距
scrollbarThickness(): number client
获取滚动条粗细
shadowVisibility(): SlateVisibility client
获取阴影显示
smoothScrollingEnable(isSmoothScrolling: boolean): void client
设定鼠标滚动时,滚动速度是否插值运算,限制滚动速度更平滑
supportElastic(): boolean client
判断是否支持惯性

Methods

endInertialScrolling(): void client
立刻停止滚动
scrollToEnd(): void client
滚动到底部
scrollToStart(): void client
滚动到开始位置
newObject(parent?: Canvas, inName?: string): ScrollBox client
创建 ScrollBox 控件

Accessors

allowOverscroll

set allowOverscroll(isAllowOverscroll): void client

设置允许滚动超过滚动框大小

Parameters

isAllowOverscroll boolean允许滚动超过滚动框大小

alwaysShowScrollBar

get alwaysShowScrollBar(): boolean client

set alwaysShowScrollBar(isScrollBarAlwaysShown): void client

获取是否一直显示滚动条

Returns

boolean是否一直显示滚动条

设置是否一直显示滚动条

Parameters

isScrollBarAlwaysShown boolean是否一直显示滚动条

animationType

get animationType(): UIScrollBoxAnimationType client

set animationType(inAnimationType): void client

获取动画类型

Returns

UIScrollBoxAnimationType动画类型

设定动画类型

Parameters

inAnimationType UIScrollBoxAnimationType类型

动画类型


defaultLocation

get defaultLocation(): ScrollBarDefaultLocation client

set defaultLocation(NewDefaultLocation): void client

返回滚动条的默认位置(类型,非具体坐标)

Precautions

没有操作滚动条的情况下滚动条的默认位置

Returns

ScrollBarDefaultLocation返回滚动条的默认位置(类型,非具体坐标)

设置滚动条的默认位置(类型,非具体坐标)

Precautions

没有操作滚动条的情况下滚动条的默认位置

Parameters

NewDefaultLocation ScrollBarDefaultLocation滚动条默认位置(类型,非具体坐标)

elasticMultiplier

get elasticMultiplier(): number client

set elasticMultiplier(inElasticMultiplier): void client

获取弹性系数

Returns

number弹性系数

设定弹性系数

Parameters

inElasticMultiplier number系数

弹性系数


onScrollEnd

get onScrollEnd(): MulticastDelegate<() => void> client

滚动结束事件

Returns

MulticastDelegate<() => void>滚动结束事件

onUserScrolled

get onUserScrolled(): MulticastDelegate<(currentOffset: number) => void> client

滚动事件

Returns

MulticastDelegate<(currentOffset: number) => void>滚动事件

orientation

get orientation(): Orientation client

set orientation(inOrientation): void client

获取滚动方向

Returns

Orientation滚动方向

设置滚动方向

Parameters

inOrientation Orientation方向

滚动方向


scrollAxisBrushDrawType

get scrollAxisBrushDrawType(): Readonly<SlateBrushDrawType> client

set scrollAxisBrushDrawType(InDrawAs): void client

获取滚动条图片绘制类型

Returns

Readonly<SlateBrushDrawType>图片绘制类型

设置图片绘制类型

Parameters

InDrawAs SlateBrushDrawType图片绘制类型

scrollAxisBrushGuid

get scrollAxisBrushGuid(): string client

set scrollAxisBrushGuid(InGUID): void client

获取滚动条图片ID

Returns

string滚动条图片ID

设置滚动条图片ID

Parameters

InGUID string图片ID

scrollAxisBrushMargin

get scrollAxisBrushMargin(): Readonly<Margin> client

set scrollAxisBrushMargin(InMargin): void client

获取滚动条图片边距

Returns

Readonly<Margin>滚动条图片边距

设置滚动条图片边距

Parameters

InMargin Margin滚动条图片边距

scrollAxisColor

get scrollAxisColor(): Readonly<LinearColor> client

set scrollAxisColor(InColor): void client

获取滚动条图片颜色

Returns

Readonly<LinearColor>滚动条图片颜色,Type.LinearColor类型,数据范围0~1

设置滚动条图片颜色

Parameters

InColor LinearColor滚动条图片颜色,Type.LinearColor类型,数据范围0~1

scrollBarVisibility

get scrollBarVisibility(): SlateVisibility client

set scrollBarVisibility(inScrollBarVisibility): void client

获取滚动条的显示于隐藏

Returns

SlateVisibility滚动条的显示于隐藏

设置滚动条是否可见,必须是在SetAlwaysShowScrollbar 为false才生效

Parameters

inScrollBarVisibility SlateVisibility滚动条是否可见

scrollOffset

get scrollOffset(): number client

set scrollOffset(inScrollOffset): void client

获取滚动框偏移

Returns

number滚动框偏移

设定滚动框滚动偏移

Parameters

inScrollOffset number滚动偏移

scrollOffsetFraction

get scrollOffsetFraction(): number client

获取滚动框距离底部的偏移比例

Returns

number滚动框偏移比例

scrollOffsetOfEnd

get scrollOffsetOfEnd(): number client

获取滚动框距离底部的偏移

Returns

number滚动框偏移

scrollWheelMultiplier

set scrollWheelMultiplier(inScrollWheelMultiplier): void client

设置鼠标滚轮系数

Parameters

inScrollWheelMultiplier number系数

鼠标滚轮系数


scrollbarPadding

set scrollbarPadding(inScrollbarPadding): void client

设置滚动条边距

Parameters

inScrollbarPadding Margin滚动条边距

scrollbarThickness

get scrollbarThickness(): number client

set scrollbarThickness(inScrollbarThickness): void client

获取滚动条粗细

Returns

number滚动条粗细

设置滚动条粗细

Parameters

inScrollbarThickness number滚动条粗细

shadowVisibility

get shadowVisibility(): SlateVisibility client

set shadowVisibility(inVisibility): void client

获取阴影显示

Returns

SlateVisibility阴影显示

设定阴影显示

Parameters

inVisibility SlateVisibility阴影显示

阴影显示


smoothScrollingEnable

set smoothScrollingEnable(isSmoothScrolling): void client

设定鼠标滚动时,滚动速度是否插值运算,限制滚动速度更平滑

Parameters

isSmoothScrolling boolean鼠标滚动时,滚动速度是否插值运算

supportElastic

get supportElastic(): boolean client

set supportElastic(inSupportElastic): void client

判断是否支持惯性

Returns

boolean是否支持惯性

设定是否支持惯性

Parameters

inSupportElastic boolean惯性

是否支持惯性

Methods


endInertialScrolling

endInertialScrolling(): void client

立刻停止滚动


scrollToEnd

scrollToEnd(): void client

滚动到底部


scrollToStart

scrollToStart(): void client

滚动到开始位置


newObject

Static newObject(parent?, inName?): ScrollBox client

创建 ScrollBox 控件

Parameters

parent? Canvas创建控件的外parent对象 default:null
inName? string创建控件的名称 default:null range:设置合理的名称即可

Returns

ScrollBox创建的对象

当parent和inName与已有的对象相同时,旧的对象会被销毁