How to make this transform with React-Native?

后端 未结 1 1154
北荒
北荒 2020-12-22 23:47

i try to use style.transform attribute but i can\'t make the transform, there is not so many doc , crying ...

here is the css3 code:

相关标签:
1条回答
  • 2020-12-23 00:19

    Here is a pretty close result:

    render() {
      return (
        <View style={styles.container}>
          <View style={styles.child} />
        </View>
      )
    },
    
    var styles = StyleSheet.create({
      container: {
          backgroundColor:'green',
          flex: 1,
      },
      child: {
        flex: 1,
        backgroundColor: 'blue',
        transform: [
          { perspective: 850 },
          { translateX: - Dimensions.get('window').width * 0.24 },
          { rotateY: '60deg'},
    
        ],
      }
    });
    

    See full example: https://rnplay.org/apps/Qg7Bhg

    0 讨论(0)
提交回复
热议问题