Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
relign opened this issue Dec 11, 2019 · 0 comments
Open

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

relign opened this issue Dec 11, 2019 · 0 comments

Comments

@relign
Copy link

relign commented Dec 11, 2019

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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant