I'm having a peculiar issue with ellipses, just on an HTC One XL running Android 4.2.2. On most devices the layout is correct, but on this device whenever text is ellipsized, it left-aligns itself and doesn't render completely.

Has anyone seen anything like this?

enter image description here

Each row is made of two TextViews in a LinearLayout oriented horizontally. Below is the style for the "score"--the problematic textview.

    <item name="android:textSize">@dimen/content_section_scores_item_score_text_size</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
    <item name="android:gravity">right</item>
    <item name="android:paddingLeft">5dp</item>
    <item name="android:singleLine">true</item>
有帮助吗?

解决方案

Painfully, the fix was quite simple.

A change from

<item name="android:singleLine">true</item>

to

<item name="android:maxLines">1</item>

fixed it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top