react-native-head-tab-view icon indicating copy to clipboard operation
react-native-head-tab-view copied to clipboard

makeScrollTrans只调用一次

Open hcy1996 opened this issue 2 years ago • 6 comments

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 avatar Nov 07 '21 14:11 hcy1996

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

hcy1996 avatar Nov 07 '21 14:11 hcy1996

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

zyslife avatar Nov 29 '21 14:11 zyslife

@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.

phamhungvn avatar Jan 28 '22 11:01 phamhungvn

@phamhungvn did you figure it out

leorod90 avatar Apr 20 '22 20:04 leorod90

@phamhungvn did you figure it out

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

phamhungvn avatar Apr 21 '22 01:04 phamhungvn

@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.

zyslife avatar Apr 21 '22 03:04 zyslife