2012-06-09 130 views
1

我的應用程序中出現TextView問題。 到目前爲止,它通常在我測試過的3個手機上正常工作,但不幸的是,在運行MIUI ROM的手機上,它往往表現得很奇怪。TextView在屏幕末尾被截斷

的字符串被在屏幕的結束切斷,而不是僅僅做一個換行符: enter image description here

它只是一個普通的TextView ...這是順便把XML代碼:

<ScrollView 
android:id="@+id/scroll_view" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 

    <LinearLayout 
    android:id="@+id/linearLayout" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    > 
      <TextView 
       android:id="@+id/question_text" 
       android:text="@string/question" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_margin="10dp" 
       android:textSize="24sp" 
       > 

任何猜測,爲什麼它會在特定的ROM中被切斷?

+0

找到問題的運氣很好。這裏同樣的問題 –

+0

它太久以前,我什至不記得我是如何得到它的工作大聲笑....... 你試過「singleline =」false「嗎? – RazorHail

+0

是的,它的工作。 –

回答

0

我會嘗試:

android:singleLine="false" 

在你的TextView

+0

,只允許字符串分成多行,我認爲OP需要在一行中 –

0

對這一問題的可能的原因是ROM使用不同的字體或手機擁有更小尺寸的顯示器,這會導致你的字符串比繩子寬。

您可以使用ellipsize參數來避免文本被「破壞」。 Here is the documentation.根據設置 - 您的textview可能在開始,中間,結尾處具有「...」符號,沒有符號並在末尾被截斷,或者水平生成動畫(字幕)。