For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/api/elements/built-in/scroll-coordinator-API.md.
Lynx
  • 简体中文
  • 属性

    android-nested-scroll-as-child

    Android
    // @默认值: false
    'android-nested-scroll-as-child'?: boolean;

    Android foldview 基于 CoordinateLayout,但它仅实现了 NestedScrollingParent,因此不支持作为子组件嵌套在其他滚动组件中,将此属性设置为 true 可使其正常工作。

    bounces

    iOS
    Harmony
    // @默认值: true
    bounces?: boolean;

    当 coordinator 滚动超出边界时启用回弹效果。

    enable-scroll

    Android
    iOS
    Harmony
    Clay Android
    Clay iOS
    // @默认值: true
    'enable-scroll'?: boolean;

    设置 coordinator 是否可以垂直滚动。

    enable-scroll-bar

    iOS
    Harmony
    // @默认值: false
    'enable-scroll-bar'?: boolean;

    设置 coordinator 滚动时滚动条是否可见。

    granularity

    Android
    iOS
    Harmony
    Clay Android
    Clay iOS
    // @默认值: 0.01
    granularity?: number;

    bindoffset 的事件响应粒度,一旦滚动距离超过可滚动距离的 granularity 倍,即可能触发。默认值为 0.01,但不一定每 0.01 都会触发。

    header-over-slot

    Android
    iOS
    Harmony
    Clay Android
    Clay iOS
    // @默认值: false
    'header-over-slot'?: boolean;

    此属性控制 header 层级是否高于 slot,当 header 溢出时,将显示在 slot 之上。否则,将显示在 slot 之下。建议显式设置此属性,而不是使用默认值。

    ios-force-scroll-detach

    iOS
    // @默认值: false
    'ios-force-scroll-detach'?: boolean;

    是否强制使 foldview 的 nested-vertical-scroll-behavior 在 iOS 上失效,此设置对其他平台无效。

    ios-scrolls-to-top

    iOS
    // @默认值: false
    'ios-scrolls-to-top'?: boolean;

    当用户点击状态栏时,距离状态栏最近的触摸下方的滚动视图将滚动到顶部。仅限 iOS 功能。

    refresh-mode

    iOS
    // @默认值: 'none'
    'refresh-mode'?: 'page' | 'none' | 'fold';

    foldview 的下拉刷新模式,none(无,默认值)、page(分类下拉刷新)、fold(整体下拉刷新)。

    事件

    前端可以绑定相应的事件回调来监听元素的运行时行为,如下所示。

    bindoffset

    Android
    iOS
    Harmony
    Clay Android
    Clay iOS
    bindoffset = (e: ScrollCoordinatorOffsetEvent) => {};
    字段类型是否可选默认值平台版本描述
    height数字否–
    Android
    iOS
    Harmony
    Clay Android
    Clay iOS
    可滚动距离的绝对值(header 高度 - toolbar 高度),单位为 px
    offset数字否–
    Android
    iOS
    Harmony
    Clay Android
    Clay iOS
    header 滚动偏移量的绝对值,单位为 px

    折叠进度回调

    方法

    前端可以通过 SelectorQuery API 调用组件方法。

    setFoldExpanded

    
    lynx.createSelectorQuery()
         .select('#id')
         .invoke({
          method: 'setFoldExpanded',
          params: {
            /**
             * 偏移量,支持 px 和 rpx
             * @Android
             * @iOS
             * @Harmony
             * @Web
             * @PC
             */
            offset: '0px',
            /**
             * 折叠时是否需要动画
             * @Android
             * @iOS
             * @Harmony
             * @Web
             * @PC
             */
            smooth: true,
          },
          success: function (res) {},
          fail: function (res) {},
        })
        .exec();
    
    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。