I have the following EditText :

 <EditText android:id="@+id/status_field" style="@style/StatusField" android:layout_marginTop="@dimen/status_marginTop" android:inputType="text" tools:ignore="LabelFor,Autofill" /> 

where the StatusField style looks like this:

 <style name="StatusField"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:ellipsize">end</item> <item name="android:singleLine">true</item> <item name="android:editable">false</item> <item name="android:layout_marginLeft">@dimen/status_margin</item> <item name="android:layout_marginRight">@dimen/status_margin</item> <item name="android:layout_marginTop">@dimen/status_margin</item> <item name="android:color">@color/enhanced_green</item> <item name="android:textSize">@dimen/status_field_text_size</item> <item name="android:hint">@string/res_MyStatusPlaceholder</item> </style> 

In this case, the long text entered in this EditText is cut off at the beginning, and only the end of the text will be visible, but if you remove android:inputType="text" , then the text is displayed from the beginning, and at the end three dots, thanks to <item name="android:ellipsize">end</item> .

Why, when adding the line android:inputType="text" , does the text change so much?

  • Krch, the fact is that the inputType attribute inputType defined and it does not stack with Ellipsize :( stackoverflow.com/q/19276320 . But I have one question, why treadmill in Edittext?) IFr0z

0