本文整理匯總了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
}),