Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void setActionBarTitleAsMarquee(){
- // Get Action Bar's title
- View v = getWindow().getDecorView();
- int resId = getResources().getIdentifier("action_bar_title", "id", "android");
- TextView title = (TextView) v.findViewById(resId);
- // Set the ellipsize mode to MARQUEE and make it scroll only once
- title.setEllipsize(TextUtils.TruncateAt.MARQUEE);
- title.setMarqueeRepeatLimit(-1);
- // In order to start strolling, it has to be focusable and focused
- title.setFocusable(true);
- title.setFocusableInTouchMode(true);
- title.requestFocus();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement