在actionbarsherlock下面添加一个视图

时间:2014-05-24 11:29:06

标签: android actionbarsherlock

我在我的应用中使用actionbarsherlock。我想在操作栏下面添加一个视图。请参阅以下屏幕截图: enter image description here

我想将4色条带添加到操作栏。怎么做?

1 个答案:

答案 0 :(得分:1)

您可以为CustomView创建ActionBar

然后你就是这样做的:

getSupportActionBar().setDisplayShowCustomEnabled(true);
getSupportActionBar().setCustomView(R.layout.my_custom_view);

here

中查看详情

编辑:实际上,你可以使用:

getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.background_action_bar));

你的抽签是这样的:

action bar background

相关问题