I am trying to add ellipses to a textview in my listview and it's not working.
Please see my xml definition below.
In this case, it's not coming either on the emulator or the device:
?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:focusable="true">
<ImageView android:id="@+id/imageview" android:layout_width="30dip"
android:layout_height="30dip" android:layout_centerVertical="true"
android:layout_alignParentLeft="true" android:src="@drawable/about"
android:layout_margin="8dip"/>
<TextView android:id="@+id/title" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/imageview"
android:textStyle="bold" android:textColor="#000000"
android:textSize="15sp" android:lines="1"
android:ellipsize="marquee" android:inputType="text"
android:marqueeRepeatLimit="3"
android:layout_marginRight="15dip"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/delete">
</TextView>
<ImageButton android:id="@+id/delete" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_centerVertical="true"
android:layout_alignParentRight="true" android:layout_marginRight="0dip"
android:layout_margin="5dip" android:src="@drawable/delete_icon"
/>
</RelativeLayout>
And in this case, it's coming on the emulator, not on the device:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView android:id="@+id/imageview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_alignParentLeft="true"/>
<TextView android:id="@+id/title" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_toRightOf="@+id/imageview"
android:textStyle="bold" android:textColor="#000000"
android:layout_marginLeft="10dip" android:layout_marginRight="10dip"
android:textSize="15sp" android:cacheColorHint="#00000000">
</TextView>
<TextView android:id="@+id/shortdesc" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_below="@+id/title"
android:layout_toRightOf="@+id/imageview"
android:textSize="15sp"
android:lines="2" android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever"
android:layout_marginLeft="10dip" android:layout_marginRight="20dip"
android:textColor="#413839" android:cacheColorHint="#00000000">
</TextView>
</RelativeLayout>
Please help, thanks for your input and time
The solutions For the first one pls see my commnets below
For the second one, i had to replace marquee with end
<TextView android:id="@+id/shortdesc" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@+id/title"
android:layout_toRightOf="@+id/imageview"
android:textSize="15sp"
android:maxLines="2" android:ellipsize="end"
android:layout_marginLeft="10dip" android:layout_marginRight="30dip"
android:textColor="#413839" android:cacheColorHint="#00000000"
android:text="asdfghjmsbvhsfadk vcdfkhreouhjkjfdgdslkfdn bfoiunbf m,cvbkjnfgb kj nbcdjfkdleoig;dkf nmvnb safdsfrtgdfgdfhg">
</TextView>