JhesterMag
JhesterMag

Reputation: 71

How to set marquee in infinite repeat limit in main activity?

What value should I put inside the parameter to make the marquee repeat limit to forever?

holder.hTextTitle.setEllipsize(TruncateAt.MARQUEE);
holder.hTextTitle.setMarqueeRepeatLimit();

Upvotes: 2

Views: 8444

Answers (4)

VladimirVip
VladimirVip

Reputation: 404

android:marqueeRepeatLimit="marquee_forever"

Also, do look at this post.

Upvotes: 0

Dario Brux
Dario Brux

Reputation: 1951

To set infinite marquee programmatically use:

TextView txt = new TextView(this);
txt.setText("This is the infinite marquee");
txt.setEllipsize(TextUtils.TruncateAt.MARQUEE);
txt.setSingleLine(true);
txt.setMarqueeRepeatLimit(-1);
txt.setSelected(true);

Upvotes: 8

Sabyasachi
Sabyasachi

Reputation: 3599

        TextView tv = (TextView) this.findViewById(R.id.textView1);
        tv.setEllipsize(TruncateAt.MARQUEE);
        tv.setText("Your text…");
        tv.setSelected(true);
        tv.setSingleLine(true);

Upvotes: 0

Andy.Zhao
Andy.Zhao

Reputation: 258

TextView textView=(TextView)findViewById(R.id.text_test);
    textView .setEllipsize(TextUtils.TruncateAt.MARQUEE);
    textView .setSingleLine(true);
    textView .setMarqueeRepeatLimit(-1);
    textView.setFocusableInTouchMode(true);
    textView.setFocusable(true);

Upvotes: 2

Related Questions