我正在尝试省略活动的标题,有人可以告诉我该怎么做吗?
setTitle("My Title");
//when the text of the title gets too long, how can I use setEllipsize() here? how can I get the view Id of that title?
我正在尝试省略活动的标题,有人可以告诉我该怎么做吗?
setTitle("My Title");
//when the text of the title gets too long, how can I use setEllipsize() here? how can I get the view Id of that title?
试试这个: http: //it-ride.blogspot.pt/2010/07/android-title-marquee.html 有些人说它有效,有些人说它没有。
该代码基于此网络链接 http://it-ride.blogspot.pt/2010/07/android-title-marquee.html
// make the title scroll!
// find the title TextView
TextView title = (TextView) findViewById(android.R.id.title);
// set the ellipsize mode to MARQUEE and make it scroll only once
title.setEllipsize(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();