2

Attempting to scroll some text horizontally on a button, not bothered if it has focus or not. Just want to scroll the text. Right now, got the button to appear, but only text I see is "My button.."

 <Button
        android:layout_width="150dip" 
        android:layout_height="wrap_content"
        android:text="My button with a long text for marquee as a example source code"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:marqueeRepeatLimit="1"/>
Marat
  • 6,142
  • 6
  • 39
  • 67
Mark James
  • 481
  • 2
  • 6
  • 18

1 Answers1

3

In the activity (.java file) you have to add the lines:

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activitymain);

        btnMarquee = (Button) findViewById(R.id.yourbuttonid);
        btnMarquee.setSelected(true);
TOM AVILA
  • 31
  • 2