如何在带有 React Native Text 的 Android 中实现软连字符

如何在带有 React Native Text 的 Android 中实现软连字符

问题描述:

<Text>
Aufmerksamkeits{'\u00AD'}defizit
</Text>

这导致在 iOS 上

Aufmerksamkeits-
赤字

Aufmerksamkeits-
defizit

但在 Android 上

But on Android to

Aufmerksamkeitsd
效率

Aufmerksamkeitsd
efizit

因此,Android 似乎忽略了给定的软连字符.我怎样才能在 Android 上也能正常工作?

So it seems that Android ignores the given soft hyphen. How can I make this work on Android as well?

谢谢!

我现在有点晚了,但我花在这上面的时间比我引以为豪的要多.如果要使用软连字符,请在字符串中使用 \u00AD,例如:

I now it is a bit late, but I spent more time on this than I am proud of. If you want to use soft hyphen use \u00AD in strings, e.g.:

Einzelfahrrad\u00ADkarte

为了使其正常工作,在您的 TextView 中,您必须添加:

In order to make this working though, in your TextView, you have to add:

android:hyphenationFrequency="full"