本文介绍了与多行操作栏标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能建立在操作栏标题与多条线路?我需要一个双倍行距称号。
Is it possible to create the title in the Action Bar with more than one line? I need a double spaced title.
推荐答案
我不太清楚,如果你正在寻找以下,但:
I am not quite sure if you were looking for the following, but:
actionBar.setSubtitle(字符串字符串)设置与下方的主标题字体较小第二条生产线。
actionBar.setSubtitle(String string) sets a second line with smaller font underneath your main Title.
例如:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_left_drawer_item_clicked);
String value = getIntent().getExtras().getString("drawerItemString");
ActionBar actionBar = getActionBar();
// Make sure we're running on Honeycomb or higher to use ActionBar APIs
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
// Show the Up button in the action bar.
actionBar.setDisplayHomeAsUpEnabled(true);
}
actionBar.setTitle(selectedBook.getTitle());
actionBar.setSubtitle(selectedBook.getAuthorName());
}
这篇关于与多行操作栏标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!