Android immersive status bar design example code

This article introduces the Android immersive status bar and shares it with you. I hope it will be helpful to you

1、 Overview

Nowadays, many mainstream app design styles use materail design. Today we will simply realize the two effects of changing the color of the status bar and making the status bar transparent.

2、 Set the color of the status bar

We write a tool class statusbarutils

The code is as follows:

Directly call the system provided method setstatusbarcolor above Android 5.0. Between 4.4-5.0, first make a full screen, and then add a layout in the part of the status bar.

3、 Set status bar transparency

code:

There are so many codes. After the analysis, you can try the effect yourself. I don't want to see the figure above.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>