在某些语言中,不会在行尾添加连字符以连接单词 [英] Hyphens are not added at line endings to join words in some languages

查看:29
本文介绍了在某些语言中,不会在行尾添加连字符以连接单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 ConstraintLayout 中有以下 TextView:

 <TextView
        android:id="@+id/title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:ellipsize="end"
        android:maxLines="3"
        android:textAppearance="@style/TextAppearance.AppCompat.Title"
        ... />

当文本太长无法在一行中显示时,它会分成两行.但是,如果系统语言设置为瑞典语,它将在单词中间中断而不添加连字符,如下所示:

When the text is too long to fit in one line, it will break into two lines. However, if the system language is set to Swedish it will break in the middle of words without adding a hyphen, like so:

一些文字是br分成两行

我不确定这是否是一个准确的例子,但你明白了.

I'm not sure if this is an accurate example, but you get the idea.

我想要的是这个:

一些文字是 br-分成两行

当系统语言设置为英语时,它确实有效.但它也适用于瑞典语.

我已经在 TextView<上尝试了 android:breakStrategy="..."android:hyphenationFrequency="..." 的所有可能组合/代码>.

I have tried all possible combinations of android:breakStrategy="..." and android:hyphenationFrequency="..." on the TextView.

compileSdkVersion 28
targetSdkVersion 28
minSdkVersion 28

推荐答案

如果语言设置为英语,则仅在换行符中添加连字符以连接单词.这可能是一个错误.来源:https://issuetracker.google.com/issues/37087785 https://issuetracker.google.com/issues/37010641 https://issuetracker.google.com/issues/79936443

Hyphens are only added to connect words in line breaks if the language is set to English. This is probably a bug. Source: https://issuetracker.google.com/issues/37087785 https://issuetracker.google.com/issues/37010641 https://issuetracker.google.com/issues/79936443

这篇关于在某些语言中,不会在行尾添加连字符以连接单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆