Is it possible to create the title in the Action Bar with more than one line? I need a double spaced title.
I found a better solution that works perfectly up to Android 4.2.2 where the icon and the title are one clickable item.
int titleId = Resources.getSystem()
.getIdentifier("action_bar_title", "id", "android");
if (titleId > 0) {
TextView title = (TextView) findViewById(titleId);
title.setSingleLine(false);
title.setMaxLines(2);
title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
}
If you are using ActionBarSherlock, use this code:
int titleId = Resources.getSystem()
.getIdentifier("action_bar_title", "id", "android");
if (titleId == 0) {
titleId = com.actionbarsherlock.R.id.abs__action_bar_title;
}
TextView title = (TextView) findViewById(titleId);
if (title != null) {
title.setSingleLine(false);
title.setMaxLines(2);
title.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
}