【问题标题】:Problem with vertical align hebrew text (rtl mode) in react native app反应本机应用程序中垂直对齐希伯来文文本(rtl模式)的问题
【发布时间】:2021-11-03 15:12:40
【问题描述】:

当我们使用不带空格的名字和姓氏时 - 一切都很好 image

但如果你在其中一个词上加空格,另一个词会升起 image

代码 JSX:

<View style={styles.nameContainer}>
   <Text style={styles.firstname} numberOfLines={1}>{firstName}</Text>
   <Text style={styles.lastname} numberOfLines={1}>{lastName}</Text>
</View>

样式:

nameContainer: {
  flexDirection: 'row',
  maxWidth: 176,
  overflow: 'hidden'
},
firstname: {
  fontSize: 16,
  color: Colors.light.text,
  fontWeight: 'bold',
  marginEnd: 4
},
lastname: {
  fontSize: 16,
  color: Colors.light.text,
  fontWeight: 'bold',
  paddingRight: isRTL ? 0 : 24,
  marginRight: isRTL ? 0 : 8,
  marginBottom: 4,
},

谁能告诉我为什么会这样?

【问题讨论】:

    标签: react-native right-to-left


    【解决方案1】:

    您好,请检查此问题https://github.com/facebook/react-native/issues/10712 可能会有所帮助。

    【讨论】:

    • tnx,不过这个有点不一样,讲的是android和ios的区别,不过我只有ios的一个问题,相同样式的文字显示在不同的高度
    猜你喜欢
    • 1970-01-01
    • 2021-10-01
    • 1970-01-01
    • 2019-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-12
    • 2019-12-29
    相关资源
    最近更新 更多