There is a TextSwitcher, in which I update the displayed text programmatically. I set the style for this text via styles.xml:
textSwitcher.setFactory(new TextViewFactory(R.style.TemperatureTextView, true)); And this is the style:
<style name="TemperatureTextView"> <item name="android:maxLines">1</item> <item name="android:ellipsize">end</item> <item name="android:textSize">18sp</item> <item name="android:textColor">#fff</item> <item name="android:gravity">center</item> </style> The style is installed without any problems, it reacts to changes (for example, change the text color in styles.xml) - everything is fine. But he doesn't seem to see maxLines and it turns out that if the text is too long, then the drawing takes place in 2 lines.