Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7016887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:50:36+00:00 2026-05-27T22:50:36+00:00

I am trying to add ellipses to a textview in my listview and it’s

  • 0

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>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:50:37+00:00Added an answer on May 27, 2026 at 10:50 pm

    if its not working in listview try to first display ellipsized textview as a standalone view listview some time can complicate things. and also try to use attribute “singleLine=false”

    also have a look at this question: lots of info related to ellipse sizing the textview.

    updated: my textview working perfectly in my app

    <TextView 
        android:id="@+id/product_desc" 
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_toLeftOf="@id/img_disclosure"
            android:layout_marginTop="5dip"
            android:layout_marginRight="5dip"
            android:ellipsize="marquee" 
            android:text="this is the sample text to test the ellipsize effect of text view"
            android:textColor="@color/results_sep_color" 
            android:textSize="15sp"
            android:textStyle="bold"
            android:singleLine="false"
            android:maxLines="2"/>
    

    Second update:

    <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:lines="1"
            android:scrollHorizontally="true"
            android:singleLine="true"
            android:text="Don't have an account sdsadfsf asdfsdfdsdd abracadabra"
    
          />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying add items to CellRendererCombo dynamically. See the code below. When I
Trying to add scrollbars to a listview within a dialog in JQueryMobile with no
I'm trying add a tab to my web page that looks like this: Using
I am trying add OR operator in awk command. The following does not work.
I'm trying to add an ellipsis to the end of the truncated strings this
I'm trying add Hits to List() (to populate the results on web pages) this
I have this communication when I'm trying add new object to my local database:
I'm trying add data triggers to the default combobox style so each text item
I am trying add picture boxes dynamically. My code is as PictureBox picture =
Im new to asp.net mvc. I'm trying add new model class but it got

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.