android - Ellipsize not working (for single line) -
i'm trying ellipsize work single line of text inside textview. i've tried workarounds (e.g. scrollhorizontally, singleline, lines, etc.) below previous questions, nothing seems happen. code (tested on htc 1 m8 (5.0.1)):
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="48dp" android:background="@drawable/file_tile_background" > <imageview android:id="@+id/file_tile_imageview" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_marginleft="16dp" android:layout_marginright="24dp" android:src="@drawable/ic_insert_drive_file_black" android:contentdescription="@string/file_tile_imageview_description" /> <textview android:id="@+id/file_tile_textview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centervertical="true" android:layout_torightof="@id/file_tile_imageview" android:text="@string/file_tile_textview_filename" android:maxlines="1" android:ellipsize="start" android:textsize="16sp" /> </relativelayout>
edit: maybe doesn't include layout in activity_main.xml , doesn't use directly?
simple solution use android:singleline="true"
.
you can find related solution on following link.
Comments
Post a Comment