I've been searching on how to make transparent actionbar in fragment and no answer so far. So, the scenario is, I create an app using Navigation Drawer, each menu refer to same actionbar in MainActivity
.
But I can't customize actionbar in transparent mode, like this Transparent Actionbar: custom tabcolor. In this:
getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
ActionBar actionBar = getActionBar();
actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#330000ff")));
actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#550000ff")));
that code had to before setContentView
, and as you know on the fragment we use onCreateView
for the layout.
How can I achieve the transparent actionbar in fragment?