How can I have a marquee using MaxLines instead of SingleLine ?
This is my TextView :
In XML
<TextView
android:text="11111111111111111111111111111111111111111111111111111111111111"
android:id="@+id/text_marquee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
/>
In Java
((TextView)findViewById(R.id.text_marquee)).setHorizontallyScrolling(true);
((TextView)findViewById(R.id.text_marquee)).setSelected(true);
You can try using this :
android:maxLength = "10"
OR
After setting android:maxLines="1"
, you have to set your inputType
too. So, set your android:inputType="text"
and that should do the trick.