sravani
sravani

Reputation: 11

Setting Long text for textviews in listview?

hi how to get this result for listview rows? i have Two textviews and and one image view should be Right ride always. if long text will come for textview1 it should be like this

        for small textfor textview1

        --------------------------
        |Textview1(23)      --->  |
        |                         |
        -------------------------- 


        for long  textfor textview1

        --------------------------
        |Textview1....(23)    --->|
        |                         |
        -------------------------- 

plz help me

Upvotes: 0

Views: 893

Answers (2)

M D
M D

Reputation: 47807

try like this:

 <TextView
                                android:id="@+id/txt_email"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:ellipsize="end"
                                android:maxEms="23"
                                android:singleLine="true"
                                android:textColor="@color/black" />

Update: Try to set like

android:maxLines="1" android:maxLength="10" android:ellipsize="marquee" 

Upvotes: 1

Mobeen Altaf
Mobeen Altaf

Reputation: 148

add these property in textview.
android:ellipsize="end" android:maxLines="1" android:scrollHorizontally="true"

Upvotes: 0

Related Questions