Search code examples
androidactionbarsherlock

Show Hide Sherlock Action Bar


I have added Sherlock action bar to an activity by using the following line in manifest:

android:theme="@style/Theme.Sherlock.Light"

I want to save on screen space and hide the action bar by default and show it only when user taps on the screen. I have seen it in Aldiko app but don't know how to implement it.

Any help is welcomed.


Solution

  • To hide use below code on your activity onCreate() method,

    getSupportActionBar().hide();
    

    To show use below code on tap event,

    getSupportActionBar().show();
    

    Follow ActionBarSherlock Usage for more details.