Note that there are some explanatory texts on larger screens.

plurals
  1. POtext:maxLines and text:ellipsize not working properly
    primarykey
    data
    text
    <p>I want to limit my TextView to 2 lines. Here's my layout XML, the TextView in question is the id/description: </p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="8dp" &gt; &lt;TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="OBJEKTBESCHREIBUNG" android:textAppearance="@style/LargeText" android:textColor="@color/myorange" /&gt; &lt;View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/myorange" /&gt; &lt;TextView android:id="@+id/description" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="4dp" android:maxLines="2" android:ellipsize="end" android:textAppearance="@style/StandardText" /&gt; &lt;Button android:id="@+id/more" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Mehr ..." android:textAppearance="@style/SmallText" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>The text is ellipsized where it should (see picture), but the next word ist still visible. </p> <p>What's causing this?</p> <p>Edit: This is the text style that I set to the TextView: </p> <pre><code>&lt;style name="StandardText"&gt; &lt;item name="android:fontFamily" tools:ignore="NewApi"&gt;sans-serif-light&lt;/item&gt; &lt;item name="android:textSize"&gt;15sp&lt;/item&gt; &lt;item name="android:textColor"&gt;#000000&lt;/item&gt; &lt;/style&gt; </code></pre> <p>Edit2: Tried removing the textAppearance attribute, but it had no effect (concerning the ellipsize 'bug'). </p> <p><img src="https://i.stack.imgur.com/hj4Bz.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload