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.

textview's ellipsize not working on maxlines = 1


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -