2012-08-31 104 views
1

我有固定寬度和高度的TextView,想要設置字符串"._MealTracker_2-MAR-2012_02-20PM.apk"但在textview中只顯示"."無法獲取它。爲什麼它發生?顯示固定大小的字符串TextView

 <TextView 
        android:id="@+id/TextView01" 
        android:layout_width="60dp" 
        android:layout_height="20dp" 
        android:layout_gravity="bottom|center_horizontal" 
        android:layout_marginBottom="@dimen/bottom_margin" 
        android:text="._MealTracker_2-MAR-2012_02-20PM.apk" 
        android:textColor="@color/bgblue" /> 
+0

你試過setText()嗎?或者將寬度設置爲「wrap_content」? – Swayam

+0

是的,我已經在我的代碼中設置了文本 –

+0

您是否嘗試過setText(「._ MealTracker_2-MAR-2012_02-20PM.apk」)? – Swayam

回答

1

設置你的文本屬性

android:singleLine="true" 
1

我試着寫串在我的TextView的,它爲我的作品.. 也許這是TextView的,因爲你的字符串的間距的問題很長時間才能在單行中打印。

2

它沒有正確顯示,因爲android:singleLine屬性沒有設置,所以它考慮多行。因爲你的文字設置爲垂直。

如果您設置了android:singleLine="true",則._MealT ...顯示在textView中。

enter image description here