0

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)

DeRagan
  • 22,827
  • 6
  • 41
  • 50
Alex
  • 16,375
  • 7
  • 22
  • 19

3 Answers3

2

I fixed by using

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

hope this works for you too

New Alexandria
  • 6,951
  • 4
  • 57
  • 77
touchchandra
  • 1,506
  • 5
  • 21
  • 37
1

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

viv
  • 6,158
  • 6
  • 39
  • 54
  • i use more no of textview's and i add all textviews in the table layout.I create all textView at runtime only(After read the data from the db) – Alex Nov 09 '10 at 05:48
  • This link http://bear-polka.blogspot.com/2009/03/marquee-feature-of-textview-in-android.html has some marquee example, i have not tried it personally, may be you can try it. Also see this post http://stackoverflow.com/questions/1827751/is-there-a-way-to-make-ellipsizemarquee-always-scroll – viv Nov 09 '10 at 05:57
0

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!

100rabh
  • 6,156
  • 5
  • 27
  • 41