首页 > 解决方案 > IOS水平旋转Y图像

问题描述

我试图在rotateY上使用反应原生动画旋转图像

问题是,在 iOS 中,与 android 相比,它唯一旋转的一半图像可以完美地做到这一点

我附上 android 和 iOS 执行的链接:

ios https://streamable.com/nmqin

安卓https://streamable.com/64p25

animateLogo () {
   this.animatedLogo.setValue(0)
   Animated.timing(
   this.animatedLogo, {
     toValue: 1,
     duration: 1500,
     easing: Easing.linear,

   }
 ).start();
 }

render() {
   const spin = this.animatedLogo.interpolate({
     inputRange: [0,1],
     outputRange: ['0deg', '1440deg']
   });

    return (
     <View style={styles.container}>

  <Animated.Image
       style={[styles.logo,{
         width:110,
         height:150,
         transform: [{ rotateY: spin }]
       }]}
         source={require('./assets/logo_white1.png')}
     />
</View>)}

我一直在尝试在转换中添加相应的但没有用

标签: react-nativeanimationrotation

解决方案


推荐阅读