Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize immersive status bar in Android

Shulou Source: shulou.com Published: 2022-05-31 22:03:26 10月03日 Update

This article mainly explains "how to achieve the immersive status bar in Android". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to achieve the immersive status bar in Android.

1. Add two properties to the first control in the layout file (usually imageview or textview).

two。 When Activity initializes the view, set it.

If (Build.VERSION.SDK_INT > = Build.VERSION_CODES.KITKAT) {/ / transparent status bar getWindow () .addFlags (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); / / transparent navigation bar getWindow () .addFlags (WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) } Thank you for your reading. The above is the content of "how to achieve the immersive status bar in Android". After the study of this article, I believe you have a deeper understanding of how to achieve the immersive status bar in Android, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Status learning content two that is attributes layout ideas situations controls files articles time more knowledge knowledge points articles follow questions practice Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MySQL Microsoft Redmi vpn