Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cndocs/animated.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static decay(value, config): CompositeAnimation;

- `velocity`:初始速度。必填。
- `deceleration`:衰减率。默认 `0.997`。
- `isInteraction`:是否在 `InteractionManager` 上创建 interaction handle。默认 `true`。
- `isInteraction`:是否创建 interaction handle。默认 `true`。
- `useNativeDriver`:为 `true` 时使用原生驱动。必填。

---
Expand All @@ -237,7 +237,7 @@ static timing(value, config): CompositeAnimation;
- `duration`:动画时长(毫秒)。默认 `500`。
- `easing`:定义曲线的缓动函数。默认为 `Easing.inOut(Easing.ease)`。
- `delay`:延迟多久后开始(毫秒)。默认 `0`。
- `isInteraction`:是否在 `InteractionManager` 上创建 interaction handle。默认 `true`。
- `isInteraction`:是否创建 interaction handle。默认 `true`。
- `useNativeDriver`:为 `true` 时使用原生驱动。必填。

---
Expand Down Expand Up @@ -274,7 +274,7 @@ static spring(value, config): CompositeAnimation;
- `restDisplacementThreshold`:位移阈值;低于该值可视为静止。默认 `0.001`。
- `restSpeedThreshold`:速度阈值(像素/秒);低于该值可视为静止。默认 `0.001`。
- `delay`:延迟多久后开始(毫秒)。默认 `0`。
- `isInteraction`:是否在 `InteractionManager` 上创建 interaction handle。默认 `true`。
- `isInteraction`:是否创建 interaction handle。默认 `true`。
- `useNativeDriver`:为 `true` 时使用原生驱动。必填。

---
Expand Down
2 changes: 1 addition & 1 deletion cndocs/animations.md
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,4 @@ const styles = StyleSheet.create({

我们可以在 Rebound 示例中使用它来更新比例 - 如果我们要更新的组件是深度嵌套的并且尚未使用“shouldComponentUpdate”进行优化,这可能会有所帮助。

如果您发现动画掉帧(每秒执行低于 60 帧),请考虑使用“setNativeProps”或“shouldComponentUpdate”来优化它们。或者,您可以在 UI 线程而不是 JavaScript 线程上运行动画 [使用 useNativeDriver 选项](/blog/2017/02/14/using-native-driver-for-animated)。您可能还想使用 [InteractionManager](interactionmanager) 将任何计算密集型工作推迟到动画完成之后。您可以使用应用程序内开发菜单中的“FPS Monitor”工具来监视帧速率。
如果您发现动画掉帧(每秒执行低于 60 帧),请考虑使用“setNativeProps”或“shouldComponentUpdate”来优化它们。或者,您可以在 UI 线程而不是 JavaScript 线程上运行动画 [使用 useNativeDriver 选项](/blog/2017/02/14/using-native-driver-for-animated)。你可能还需要将计算密集型工作推迟到 JS 线程空闲时执行(例如使用 `requestIdleCallback`)。您可以使用应用程序内开发菜单中的“FPS Monitor”工具来监视帧速率。
Loading