Beginner
Beginner

Reputation: 85

How to make the actionbar hide and show when we touch the screen?

My question was when we touch or scrolling the webview, the actionbar will show and then it will hide by itself in a period of time like 3 seconds

Upvotes: 3

Views: 1503

Answers (2)

carlosavoy
carlosavoy

Reputation: 99

If you want it to be shown whenever you are scrolling up and hide when scrolling down you can use touch gestures, please see here for a complete explanation https://developer.android.com/training/gestures/index.html

Upvotes: 0

Lokesh
Lokesh

Reputation: 5368

inside your touch event do like this:

if(getActionBar().isShowing()){
        getActionBar().hide();
    }else{
        getActionBar().show();
    }

Upvotes: 3

Related Questions