I have a layout in which an EditText is filled by the user, then later on it becomes disabled to act as standard TextView.
Problem is, the ellipsize never works on this EditText. I'd like it to display "..." at the end of the text when it is too large to be displayed completely, but I can't find any way to make it works, and I have no idea why it doesn't.
Here is my layout
<RelativeLayout
android:id="@+id/search_container"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_below="@+id/toolbar"
android:background="@drawable/bg_border_bot_clickable"
android:addStatesFromChildren="@+id/ic_edit"
android:animateLayoutChanges="true">
<View
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:layout_alignParentLeft="true"
android:background="@drawable/ic_action_search"
android:id="@+id/ic_search" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textColorHint="@color/text_hint"
android:hint="@string/search_hint"
android:id="@+id/et_search"
android:textColor="@android:color/white"
android:inputType="text|textCapSentences"
android:ellipsize="end"
android:singleLine="true"
android:lines="1"
android:imeOptions="actionSearch"
android:background="@drawable/transition_rounded_rectangle"
android:layout_toLeftOf="@+id/ic_edit"
android:layout_toRightOf="@+id/ic_search"
/>
<View
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:background="@drawable/ic_edit"
android:id="@+id/ic_edit"
android:visibility="gone"
android:clickable="true"/>
</RelativeLayout>
Any ideas on how to accomplish that?
Aucun commentaire:
Enregistrer un commentaire