Display a long string in a spinner without cutting

In my current application, if the line is too long and does not fit on the screen, it is truncated. How to display sliding text for long lines in a spinner (I saw this in some applications)?

+3
source share
2 answers

A Spinnerextends AdapterView(e.g. ListView), which is supported by the class Adapter.

Just as you can customize each line in ListView, you must do the same for your own Spinnerby overriding the method, for example . Adapter.getView()

Here you can return a simple TextViewproperty ellipsize.

+2
source

textview, ellipsize .

0

Source: https://habr.com/ru/post/1744929/


All Articles