防止在Android TextView中拆分单词

时间:2014-01-12 04:24:21

标签: android android-layout

我有TextView,如下所示

    <TextView
    android:layout_width="fill_parent"
    android:layout_height="0dp"
    android:layout_weight="2"
    android:layout_margin="20dp"
    android:ellipsize="end"
    android:id="@+id/statement"
 />

使用以下代码从我的strings.xml文件中获取其内容。

Statement = (TextView) getView().findViewById(R.id.statement);
Statement.setText(R.string.TransferorStatement);

strings.xml文件中的文字是

 <string name="TransferorStatement">I a resident of the State of having “Transferred” the firearm described below swear or affirm that the information below is true and correct to the best of my knowledge and belief and that the Transferee has presented identification from the State of that matches the Transferee’s statement below.</string>

我遇到的问题是单词在行结尾处被分开。
从我的研究中

android:ellipsize="" 

参数应该可以防止这种情况发生。

但是我已经尝试了ellipsize的每个选项,它在文本换行中没有任何区别。

Image of the Problem

0 个答案:

没有答案