本文整理汇总了TypeScript中react-native.Animated.timing方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Animated.timing方法的具体用法?TypeScript Animated.timing怎么用?TypeScript Animated.timing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类react-native.Animated
的用法示例。
在下文中一共展示了Animated.timing方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: switch
convertTransitionDefinition: (
{ raw, useNativeDriver },
def,
{ toValue }
) => {
if (isAction(def)) return def;
const animationProps = {
...def,
toValue,
useNativeDriver
};
switch (def.type) {
case 'spring':
return Animated.spring(
raw,
animationProps as Animated.SpringAnimationConfig
);
default:
return Animated.timing(
raw,
animationProps as Animated.TimingAnimationConfig
);
}
},
示例2:
const linearTween: Transition = ({ value, toValue, useNativeDriver = true }) =>
Animated.timing(value, {
toValue,
duration: 300,
easing: v => v,
useNativeDriver
});
示例3:
getInstantTransition: ({ raw, useNativeDriver }, { toValue }) =>
Animated.timing(raw, {
toValue,
duration: 0,
useNativeDriver
}),