如何在 React Native 中旋转字体真棒图标?

MD.*_*NIM 7 stylesheet react-native react-native-android font-awesome-5

在我的 React Native 应用程序中,我有一个很棒的字体图标。我想旋转它。需要帮助。

import React from 'react'
import { View  } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome5';

const InfoBox = () => {
    return (
          <View >
            <Icon name={'hand-holding-usd'} size={20}/>
          </View>

    )
}

export default InfoBox;
Run Code Online (Sandbox Code Playgroud)

Nis*_*air 26

您可以使用style道具来旋转图标。根据需要更改旋转的度数/方向

<Icon name={'hand-holding-usd'}
      size={20}
      style={{transform: [{rotateY: '180deg'}]}}/>
Run Code Online (Sandbox Code Playgroud)

  • 谢谢你的帮助。我用这种方式解决了我的问题。`&lt;图标名称={'hand-holding-usd'} size={20} style={{transform: [{rotateY: '180deg'}],position: 'absolute',left:0}}/&gt;` (2认同)