Skip to content
This repository was archived by the owner on Oct 19, 2025. It is now read-only.
This repository was archived by the owner on Oct 19, 2025. It is now read-only.

react-native bind scroller 横向滚动失败 #90

@relign

Description

@relign

react-native 下面使用 bindingx, 当 ScrollView 设置 横向滚动,horizontal={true} 时,不会生效。
JSX:

<View
          ref={c => { this.instance = c }}
          style={{
          // position: 'absolute',
          // top: 270,
          height: 300,
          width: '100%',
          backgroundColor: 'red'
    }}/>
 <ScrollView horizontal={true} ref={c => { this.carouselRef = c }}>
        {images}
 </ScrollView>

JS:

let anchor = findNodeHandle(this.carouselRef)
    let target = findNodeHandle(this.instance);
    let token = bindingx.bind({
      eventType: 'scroll',
      anchor: anchor,
      props: [
        {
          element: target,
          property: 'transform.translateY',
          expression: 'x+0'
        }
      ]
    }, this.onStateChange);

    this._token = token.token;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions