You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/custom-animation.md
+32-48Lines changed: 32 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,15 @@ After some effort, we finally implemented custom animation in v2, now we just ne
8
8
type TAnimationStyle = (value: number) => Animated.AnimatedStyleProp<ViewStyle>;
9
9
```
10
10
11
-
12
11
This function will be called in each item and accepts a parameter `value` indicating the position of the current item relative to `window`. The following picture shows the relationship between `value` and position
After getting the `value`, we only need to describe how the item is displayed in the corresponding position, and the rest is handed over to `Animated` to execute.
In order to implement some animation effects outside `Carousel`, such as `MaskView`, we pass the animation value calculated inside each Item to the outside through `renderItem`.
@@ -110,22 +106,19 @@ In order to implement some animation effects outside `Carousel`, such as `MaskVi
0 commit comments