gpt4 book ai didi

react-native - React Native rotateY 导致文本模糊

转载 作者:行者123 更新时间:2023-12-03 22:45:32 24 4
gpt4 key购买 nike

我正在 React Native 中为 iOS 设备开发一个翻盖组件,这就是我的方法:

<Animated.View ref="container" style={{position:'relative',transform:[{rotateY:'0deg'}]}}>
<View ref="frontFace"><Text>Front face</Text></View>
<View ref="backFace" style={{transform:[{rotateY:'-180deg'}]}}><Text>Back face</Text></View>
</Animated.View>
  • 在容器 View 中使用绝对位置重叠两个 View
  • 使用rotateY翻转背面:'-180deg'
  • 当轻按翻转按钮时,通过将容器的rotateY 从'0deg' 插入到'180deg',使用Animated 组件翻转容器

  • 对上面过于简化的代码感到抱歉——这段代码也能正常运行。问题在于模拟器中的背面模糊,并且在设备上像素化难看。

    有没有办法来解决这个问题?或者关于如何实现翻盖组件的任何更好的建议?

    谢谢!!!

    最佳答案

    代替
    transform: [{ rotateY: '-180deg'}]
    风格:
    transform : [{scaleX: -1}]
    解决了。

    关于react-native - React Native rotateY 导致文本模糊,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33072374/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com