Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 在React Native中,如何水平翻转视图?_React Native_Transform - Fatal编程技术网

React native 在React Native中,如何水平翻转视图?

React native 在React Native中,如何水平翻转视图?,react-native,transform,React Native,Transform,假设我有一个这样的图标: <FontAwesome name={'column'} size={20} style={ /* mirror horizontally */ } /> 如何在水平方向上镜像此属性?React native使用一组转换,根据,该属性已被弃用。您可以在x轴上按逆比例缩放变换: style={{ transform: [ { scaleX: -1 } ] }} 反应本机转换接受数组。因此,必须传递值以进行变换,如

假设我有一个这样的图标:

<FontAwesome
    name={'column'}
    size={20}
    style={ /* mirror horizontally */ }
/>


如何在水平方向上镜像此属性?

React native使用一组转换,根据,该属性已被弃用。您可以在x轴上按逆比例缩放变换:

style={{
  transform: [
    { scaleX: -1 }
  ]
}}

反应本机转换接受数组。因此,必须传递值以进行变换,如下所示:



我正在进行
转换。forEach
不是一个函数。您可能需要共享更多代码。这是一个CSS规则,所以我不希望能够调用它的函数。@TIMEX在做了一点研究后更新了我的答案,react native transform道具自我上次使用以来发生了一些变化。