CoordinatorLayout + immersive status bar, coordinatorlayout
No gif said * B
Pay attention to the changes in the status bar (if I were you, I wouldn't care about the toast below)
I checked a lot of articles and blogs for this effect ,, either the background of the starting image is not filled in the status bar or the background of the starting image is filled in the status bar, but the background color of the status bar changes when it is pulled up .... later, I could not find a better method, so I had to steal the chicken (coincidentally ).
Step 1: Set the immersive Status Bar
I don't know what's going on. I am here to paste the code, but I am always unable to paste it into fk... you have to work hard and have a lot of immersive status bar links on the Internet. You can check them out.
Walk you ----------------------------- >>> immersive Status Bar
Step 1
-V19
-V21
-V23
Step 2 set the CoordinatorLayout effect layout. If you haven't seen this layout, first check how it is implemented.
Walk you -------------------------- android CoordinatorLayout
Let's take a look at my overall layout.
Android CoordinatorLayout is used. If you have a good idea about this control, you should have no doubt about the layout file.
Step 3 set the immersive Status Bar
Add the topic we just set in the list file
TranslucentTheme is yours.
Did you find that my layout does not contain android: fitsSystemWindows = "true "?
If we do not set this sentence, it will hide our title bar under the status bar (yes, if this effect is correct)
Because the height of the mobile phone status bar is about 20dp, I moved the ToolBar to 20dp.
In this way, the gif effect will appear. Remember not to set android: fitsSystemWindows = "true ".
Okay, you can go to your project and have a look.
I am just a method to steal a chicken (I don't want to move down the ToolBar by 20 DP). I also don't have a better way. If you have a better way, please tell me.
This is my QQ 765307272. Please tell me.