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

makeScrollTrans只调用一次 #125

Open
hcy1996 opened this issue Nov 7, 2021 · 6 comments
Open

makeScrollTrans只调用一次 #125

hcy1996 opened this issue Nov 7, 2021 · 6 comments

Comments

@hcy1996
Copy link

hcy1996 commented Nov 7, 2021

Describe the bug

makeScrollTrans问题:
只初始化时调用了一次,
想问下如何实时获取滚动的高度?

Expected behavior

Package versions

  • React:16.8.6
  • React Native:0.60.5
  • React-Native-Gesture-Handler:1.4.1
@hcy1996
Copy link
Author

hcy1996 commented Nov 7, 2021

用的是react-native-head-tab-view3.0.5的版本

@zyslife
Copy link
Owner

zyslife commented Nov 29, 2021

@hcy1996 是只会调一次,会返回给你一个动画对象,你监听这个对象就能获取高度了

@phamhungvn
Copy link

@zyslife I'm using latest version which work with reanimated v2
"react-native-head-tab-view": "^4.0.0-rc.13",
"react-native-tab-view-collapsible-header": "^2.0.1",

At makeScrollTrans, the value just able to get once time, it's 0 at initial.

makeScrollTrans?: (scrollValue: Reanimated2.SharedValue<number>) => void;

It's a bug right?
How to get changed value when scrolling the screen? Thanks!

For v3 I can get changed value by listen on the Animated.Value.

@leorod90
Copy link

@phamhungvn did you figure it out

@phamhungvn
Copy link

@phamhungvn did you figure it out

@leorod90 Not yet. I keep use old version v3 instead of upgrading to v4

@zyslife
Copy link
Owner

zyslife commented Apr 21, 2022

@phamhungvn @leorod90 You can look at this example.
You can use the useDerivedValue function of Reanimated2.Do what you want by listening for changes in the animation value.

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

4 participants