TextView title = (TextView) findViewById(android.R.id.title);
title.setEllipsize(TruncateAt.MARQUEE);
title.setMarqueeRepeatLimit(1);
title.setFocusable(true);
title.setFocusableInTouchMode(true);
title.requestFocus();
1. You can use android.R.id.title to get default title textview of normal Activity.
2. setMarqueeRepeatLimit is to set how many times the marquee repeat, set -1 if no limit.
3. In my case, I need to add 2 more lines to make it works:
title.setTextColor(Color.WHITE);
title.setSingleLine(true);
No comments:
Post a Comment