2
TextView txt = new TextView(this);
    txt.setText(“This is moving text”); 
    txt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    txt.setTextColor(Color.rgb(187, 88, 15));
    txt.setPadding(10, 10, 0, 0);
    txt.setEllipsize(TruncateAt.MARQUEE);
    txt.setSingleLine();
    txt.setMarqueeRepeatLimit(10);
    txt.setFocusable(true);
    txt.setHorizontallyScrolling(true);
    txt.setFocusableInTouchMode(true);
    txt.requestFocus();
    txt.setTypeface(Typeface.SERIF,Typeface.BOLD);

I tried to create the moving text for the textview but it will not moving . i try to use setMarqueeRepeatLimit . how to do it?

user1635224
  • 1,623
  • 2
  • 15
  • 15

1 Answers1

4

the answer is:

TextView txt = new TextView(this);     
txt.setText(“This is moving text”);      
txt.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);     
txt.setTextColor(Color.rgb(187, 88, 15));     
txt.setPadding(10, 10, 0, 0);     
txt.setEllipsize(TruncateAt.MARQUEE);     
txt.setSingleLine();     
txt.setMarqueeRepeatLimit(10);     
txt.setFocusable(true);     
txt.setHorizontallyScrolling(true);     
txt.setFocusableInTouchMode(true);     
txt.requestFocus();     
txt.setLayoutParams(new TableRow.LayoutParams(130, TableRow.LayoutParams.FILL_PARENT));
txt.setTypeface(Typeface.SERIF,Typeface.BOLD); 
user1635224
  • 1,623
  • 2
  • 15
  • 15