android - can i set all textviews to marquee? -
i have 6 textviews , want them marquee @ same time
<textview android:ellipsize="marquee" android:focusable="true" android:focusableintouchmode="true"/> <textview android:ellipsize="marquee" android:focusable="true" android:focusableintouchmode="true">
is possible?
code
textview txt2 = (textview)findviewbyid(r.id.textview2) txt2.setselected(true);
but crashes app
try :- hope out..... :)
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:padding="5dip" android:scrollhorizontally="true" android:singleline="true" android:text="hello world" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textview1" android:ellipsize="marquee" android:marqueerepeatlimit="marquee_forever" android:padding="5dip" android:scrollhorizontally="true" android:singleline="true" android:text="testing!!!" /> </relativelayout>
try in activity
@override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); animation animationtoleft = new translateanimation(400, -400, 0, 0); animationtoleft.setduration(12000); animationtoleft.setrepeatmode(animation.restart); animationtoleft.setrepeatcount(animation.infinite); animation animationtoright = new translateanimation(-400,400, 0, 0); animationtoright.setduration(12000); animationtoright.setrepeatmode(animation.restart); animationtoright.setrepeatcount(animation.infinite); textview tv = (textview) findviewbyid(r.id.textview02); textview tv1 = (textview) findviewbyid(r.id.textview03); tv.setanimation(animationtoleft); tv1.setanimation(animationtoright); string textleft = "really long scrolling text goes here.... ..... ............ .... ...."; string textright = "testing"; tv.settext(textleft); tv1.settext(textright); }
Comments
Post a Comment