SusScrollView

可滚动内容宿主 —— 垂直、水平,或两者兼有。
包
SusKit · 原子(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
Mode | Prop<string> | "vertical" | |
HideHorizontal | Prop<bool> | true | |
HideVertical | Prop<bool> | false | |
WheelScrollSize | Prop<float> | 48f |
插槽
没有插槽。
事件
没有公开事件。
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-scrollsus-scroll__viewsus-scroll__view--nativeunity-base-slider__draggerunity-base-slider__trackerunity-scroll-view__content-and-vertical-scroll-containerunity-scroller__high-buttonunity-scroller__low-buttonunity-scroller--horizontalunity-scroller--vertical
用法
csharp
var scroll = new SusScrollView();
scroll.Mode.Value = "vertical";
scroll.HideHorizontal.Value = true;
scroll.WheelScrollSize.Value = 48f;
scroll.Add(longListRoot);xml
<template>
<sus:SusScrollView Mode="vertical">
<!-- children go into the scroll content -->
</sus:SusScrollView>
</template>模式
vertical · horizontal · both
备注
- 优先使用
Add(...)/ClearContent(),让子元素进入内部内容宿主,而不是 chrome。 - 当包装与 flex column 布局冲突的 Unity 原生 collection view 时,
SusScrollView.StyleNative(...)会有帮助。