Вопрос

I already tryed alot of solutions, maxLine, maxLenght, marqueeAlwaysShowing, the ellipsize with marquee..the focusable thing.. I can't can't just get it working.

I erased all the additional XML to make it working and here it is, this is what I have:

 <LinearLayout
        android:id="@+id/promptDefine"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >



        <TextView
            android:id="@+id/counterDefinitionName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:onClick="nameCounting"
            android:text="@string/nameIt"
            android:textColor="@color/count_item_to_be_defined"


         />


    </LinearLayout>

So, what should I have to add it at textview to limit text to 10 characters ? but if they are more just insert the "..." at the end. I already tryed some things like:

   android:singleLine="true"
    android:ellipsize="marquee" 
    android:marqueeRepeatLimit="marquee_forever"

And didn't work, thanks in advance!

EDIT:

Maybe its the Clickable feature attribute that is messing this ?

Это было полезно?

Решение

The three dot only shows when the textView doesn't have enough space for the characters.

in your case just set a fix width and set single line. then it should work.

<TextView android:id="@+id/counterDefinitionName"
            android:layout_width="30dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:clickable="true"
            android:onClick="nameCounting"
            android:text="@string/nameIt"
            android:singleLine="true"
            android:textColor="@color/count_item_to_be_defined" />

Другие советы

not "clickable", make it "selected"

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top