Make ActionBar overlay using ActionBarSherlock

前端 未结 1 1522
悲哀的现实
悲哀的现实 2021-02-11 01:41

The last few days I\'ve been doing great stuff in development, but I\'ve seem to have hit a wall on something probably stupid simple. It\'s annoying. I was hoping I could get so

相关标签:
1条回答
  • 2021-02-11 02:15

    OK, so apparently, with my set-up, you can't do it using themes.

    I ended it up doing it, globally like this.

    setTheme(theme.whatever);
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.content);
    getSupportActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.color)); // This is #212121 solid color for the dark action bar.
    

    The lines are spread out over my code, but this is the gist of it. The order is important.

    I also found out that sliding menu seemed to be blocking the overlay mode. I had to remove the instance for it to work. I'm still looking for a way to enable both overlay mode and the sliding menu.

    0 讨论(0)
提交回复
热议问题