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)
I fixed by using
android:layout_height="wrap_content"
android:inputType="textMultiLine"
hope this works for you too
In case you have "lengthy text ", use height as wrap_content and it will break the line, and adjust the height as per content
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!
精彩评论