Apologies for this basic question, as I\'m a complete novice to Android:
I can make my TextView
scroll horizontally on one line.
But what I need is
refer this GitHub Project it has a wonderful example in it too.
Edit: make your xml some thing like this:
In your activity class:
private VerticalMarqueeTextView _txtView1; //declare a member variable
In onCreate()
:
_txtView1 = (VerticalMarqueeTextView) findViewById(R.id.mTextView1);
_txtView1.setMovementMethod(new ScrollingMovementMethod());
And in other activity lifecycle methods:
@Override
protected void onResume() {
// Start or restart the Marquee if paused.
if (_txtView1.isPaused()) {
_txtView1.resumeMarquee();
}
super.onResume();
}
@Override
protected void onPause() {
// Pause the Marquee when the Activity pauses.
_txtView1.pauseMarquee();
super.onPause();
}
@Override
protected void onDestroy() {
_txtView1.stopMarquee();
super.onDestroy();
}