2013-03-07 108 views
7

在我的Samsung Galaxy Nexus上,行爲正常,顯示三個點,但在Samsung S2中,它只顯示一個點。只有一個佈局文件:「Ellipsize」只顯示一個點

<TextView 
    android:id="@+id/textViewOfferTitle" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_toLeftOf="@+id/textViewRedemptionDate" 
    android:layout_alignParentLeft="true" 
    android:ellipsize="end" 
    android:singleLine="true" 
    android:textColor="@color/pontai_dark_gray" 
    android:textSize="@dimen/ndp_font_size" /> 

這是例子:

http://img109.imageshack.us/img109/5118/96452147.png

有沒有人見過這個?

+1

這是否發生在GS2上的所有文本視圖中?我知道三星用他們的用戶界面做了一些奇怪的事情,特別是在他們的舊設備上,所以它可能是這個產品。 – MCeley 2013-03-07 19:52:32

+0

我見過一些索尼愛立信設備顯示正方形而不是...:S – Warpzit 2013-03-07 20:09:29

+0

@Warpzit是的,很多製造商喜歡把自己的皮膚放在東西之上,並導致很多功能上的小差異。儘管忘記了一些小事,摩托羅拉的老款Motoblur皮膚有時甚至完全無法使用。 – MCeley 2013-03-07 20:40:05

回答

0

不能保證文本如何被省略(如果你問我,單個點有點誤導,但它可以被解釋爲一個折點)。如果您想確保「三點」行爲,您可以自由劃分TextView並添加您的自定義行爲。一個例子可以看到on this SO question(只是不打擾代碼中的「多行」部分)。長話短說,省略號的單點不應該成爲問題。

+0

爲什麼downvote?單點是橢圓化的「Samsung Galaxy SII方式」,這個答案有什麼問題? – 2014-11-21 16:31:22

2

刪除

android:singleLine="true" 

,並嘗試

android:lines="1" 
android:ellipsize="end" 

這對我的作品。