当我尝试在 TextView 中显示带有文件扩展名的文本时,它会错误地换行。文本每次都在第一个文件扩展名之前的最后一个单词上换行,并以点开头。
代码示例:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/margin_regular">
<TextView
android:id="@+id/attachFileConditions"
android:layout_width="300dp"
android:background="#cccccc"
android:layout_height="wrap_content"
android:text="Some file extensions: .docx, .jpg, .pdf, .png, .xls, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx, .xlsx" />
</LinearLayout>
结果是这样的:
预期结果