Alex
Alex

Reputation: 16675

Show lengthy text in TextView?

I create a TextView by using java code.I need to create textView with the width 50;If the textView has a lengthy text how to display the full text.Is there any marquee in android?If it exist how to apply it in textView???

Note:

i use more no of textview's and i add all textviews in to the table layout.I create all textView at runtime only(After read the data from the db)

Upvotes: 0

Views: 4225

Answers (3)

touchchandra
touchchandra

Reputation: 1566

I fixed by using

android:layout_height="wrap_content"
android:inputType="textMultiLine"

hope this works for you too

Upvotes: 2

100rabh
100rabh

Reputation: 6186

Yes there are provisions for marquee text .Check this http://developer.android.com/reference/android/widget/TextView.html#setEllipsize(android.text.TextUtils.TruncateAt)

Use this

    TextView tt = (TextView) v.findViewById(R.id.txtArticleTitle);
    tt.setEllipsize(TruncateAt.MARQUEE);
    tt.setMarqueeRepeatLimit(1);

Also check http://developer.android.com/reference/android/widget/TextView.html#setMarqueeRepeatLimit(int) & you are done!

Upvotes: 0

viv
viv

Reputation: 6177

In case you have "lengthy text ", use height as wrap_content and it will break the line, and adjust the height as per content

Upvotes: 1

Related Questions