Answer the question
In order to leave comments, you need to log in
How to hide AppBarLayout programmatically in android?
(Corrected code!) Hello people, tell me how to hide the AppBar or what is the correct name? (ActionBar) in general, it doesn't matter! In my project there is such an AppBarLayout, I try to hide it programmatically, but my code does not work out
if (bla bla bla){
AppBarLayout AppBarLayout = findViewById(R.id.appbar_layout);
AppBarLayout .setVisibility(View.GONE);
}else{
AppBarLayout .setVisibility(View.VISABLE);
}
Answer the question
In order to leave comments, you need to log in
Find the view that occupies this space and hide it in the same way as you do it now. This is probably the parent of the toolbar. You can see it with the Layout inspector.
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question