1. What should I do if I only want TextView to display a row, but the text exceeds the length of TextView?
Show ellipsis at the beginning
[Html] android: singleLine = "true"
Android: ellipsize = "start"
Show ellipsis at the end
[Html]
Android: singleLine = "true"
Android: ellipsize = "end"
Show ellipsis in the middle
[Html]
Android: singleLine = "true"
Android: ellipsize = "middle"
Automatic horizontal scrolling (running horse light effect)
[Html]
Android: singleLine = "true"
Android: ellipsize = "marquee"
Android: marqueeRepeatLimit = "marquee_forever"
Android: focusable = "true"
Android: focusableInTouchMode = "true"
Android: singleLine = "true" must be added to all the above four effects, because TextView will automatically wrap by default.
Android: ellipsize indicates how to display long text
Android: marqueeRepeatLimit = "marquee_forever" indicates that the settings are always repeated. You can also set specific numbers.
Android: focusable = "true" and android: focusableInTouchMode = "true" must be added. Otherwise, the rolling effect will fail.
2. How can I make TextView scroll vertically?
Add the following sentence to the Java code to implement vertical scrolling.
[Java]
TextView. setMovementMethod (ScrollingMovementMethod. getInstance ());
From the column of zookeeper