The Google Maps application has a transparent ActionBar, through which the map is visible.
You can also set it at run-time:
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
This will the ActionBar a semi-transparent floating bar.
Like any requestWindowFeature...
, this should be called before adding content.
After the setContentView
, you can then set a background from your Drawable
with this:
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.actionbar_bg));
Change getActionBar
with getSupportActionBar
for ActionBarSherlock
actionbar_bg.xml
with the root element of shape:
Although I find Tomik's solution great, this will be useful for those one-off cases for a few activities rather than an across the board style.