アクティビティのタイトルを省略しようとしていますが、その方法を教えてください。
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 そこには、機能すると言う人もいれば、機能しないと言う人もいます。
コードは、この Web リンク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();