Die*_*ano 21
你可以这样做:
final int actionBarTitle = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
final TextView title = (TextView)getWindow().findViewById(actionBarTitle);
if ( title != null ) {
title.setEllipsize(TextUtils.TruncateAt.MIDDLE);
}
Run Code Online (Sandbox Code Playgroud)
((TextView) ((FrameLayout) ((LinearLayout) ((ViewGroup) getWindow()
.getDecorView()).getChildAt(0)).getChildAt(0)).getChildAt(0))
.setEllipsize(TextUtils.TruncateAt.MIDDLE);
Run Code Online (Sandbox Code Playgroud)
从 android 中获取:将标题栏设置在中间
| 归档时间: |
|
| 查看次数: |
4301 次 |
| 最近记录: |