当前位置:网站首页>Set status bar color
Set status bar color
2022-07-02 02:22:00 【Rannki】
Import dependence : implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
// Set the status bar color to white
ImmersionBar.with(this).statusBarColor(R.color.white)
.fitsSystemWindows(true).init();Basic usage ( Meet daily immersion ):ImmersionBar.with(this).init();
ImmersionBar.with(this)
.transparentStatusBar() // Transparent status bar , Do not write default transparent color
.transparentNavigationBar() // Transparent navigation bar , Do not write default black ( Set this method ,fullScreen() The method is automatically true)
.transparentBar() // Transparent status bar and navigation bar , Do not write the default status bar as transparent , The navigation bar is black ( Set this method ,fullScreen() The method is automatically true)
.statusBarColor(R.color.colorPrimary) // Status bar color , Do not write default transparent color
.navigationBarColor(R.color.colorPrimary) // Navigation bar color , Do not write default black
.barColor(R.color.colorPrimary) // Customize the status bar and navigation bar colors at the same time , Do not write the default status bar as transparent , The navigation bar is black
.statusBarAlpha(0.3f) // Status bar transparency , Don't write default 0.0f
.navigationBarAlpha(0.4f) // Navigation bar transparency , Don't write default 0.0F
.barAlpha(0.3f) // Status bar and navigation bar transparency , Don't write default 0.0f
.statusBarDarkFont(true) // The status bar font is dark , Do not write default light color
.flymeOSStatusBarFontColor(R.color.btn3) // modify flyme OS Status bar font color
.fullScreen(true) // With navigation bar ,activity Full screen display , That is to say activity The bottom is covered by the navigation bar , Do not write default non full screen
.hideBar(BarHide.FLAG_HIDE_BAR) // Hide the status bar or navigation bar or both , Don't write default don't hide
.addViewSupportTransformColor(toolbar) // Setting up support view Color change , Multiple can be added view, Don't assign color , The default color is the same as the status bar , There are also two overload methods
.titleBar(view) // Solve the problem of overlapping the status bar and layout , Choose one of them
.titleBarMarginTop(view) // Solve the problem of overlapping the status bar and layout , Choose one of them
.statusBarView(view) // Solve the problem of overlapping the status bar and layout , Choose one of them
.fitsSystemWindows(true) // Solve the problem of overlapping the status bar and layout , Choose one of them , The default is false, When it comes to true Be sure to designate statusBarColor(), Otherwise, the status bar is transparent
.supportActionBar(true) // Support ActionBar Use
.statusBarColorTransform(R.color.orange) // The color after the status bar changes color
.navigationBarColorTransform(R.color.orange) // The color after the navigation bar changes color
.barColorTransform(R.color.orange) // The color of the status bar and navigation bar after changing color
.removeSupportView(toolbar) // Remove the specified view Support
.removeSupportAllView() // Remove all view Support
.navigationBarEnable(true) // Can I change the navigation bar color , The default is true
.navigationBarWithKitkatEnable(true) // Can I modify Android 4.4 and emui3.1 Mobile navigation bar color , The default is true
.fixMarginAtBottom(true) // Deprecated , When xml Use in android:fitsSystemWindows="true" Attribute , solve 4.4 and emui3.1 Sometimes there is a problem of extra space at the bottom of the phone , The default is false, Not necessary
.addTag("tag") // Mark the parameters set above
.getTag("tag") // according to tag Get immersive parameters
.reset() // Reset so immersive parameters
.keyboardEnable(true) // Solve the conflict between the soft keyboard and the bottom input box , The default is false, There is also an overload method , You can specify a soft keyboard mode
.init(); // Must be called to immerse
If you want to hide the status bar , You can set it like this :
activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
边栏推荐
- 剑指 Offer II 031. 最近最少使用缓存
- essay structure
- CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
- Construction and maintenance of business websites [10]
- Flutter un élément au milieu, l'élément le plus à droite
- [graduation season] graduate seniors share how to make undergraduate more meaningful
- Opengauss database backup and recovery guide
- [learn C and fly] 2day Chapter 8 pointer (practice 8.1 password unlocking)
- Software testing learning notes - network knowledge
- From January 11, 2007 to January 11, 2022, I have been in SAP Chengdu Research Institute for 15 years
猜你喜欢

How to hide the scroll bar of scroll view in uniapp

Pat a-1165 block reversing (25 points)

Vsocde has cli every time it is opened js

Infix expression to suffix expression (computer) code

leetcode373. 查找和最小的 K 对数字(中等)

【带你学c带你飞】2day 第8章 指针(练习8.1 密码开锁)

附加:信息脱敏;

Opencascade7.6 compilation

As a software testing engineer, will you choose the bank post? Laolao bank test post

CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
随机推荐
How to batch add background and transition effects to videos?
Deployment practice and problem solving of dash application development environment based on jupyter Lab
leetcode2310. The one digit number is the sum of integers of K (medium, weekly)
Build a modern data architecture on the cloud with Amazon AppFlow, Amazon lake formation and Amazon redshift
MySQL operates the database through the CMD command line, and the image cannot be found during the real machine debugging of fluent
leetcode2312. Selling wood blocks (difficult, weekly race)
【带你学c带你飞】3day第2章 用C语言编写程序(练习 2.3 计算分段函数)
leetcode2312. 卖木头块(困难,周赛)
Which is a good Bluetooth headset of about 300? 2022 high cost performance Bluetooth headset inventory
How to build and use redis environment
Sword finger offer 62 The last remaining number in the circle
大厂裁员潮不断,双非本科出身的我却逆风翻盘挺进阿里
AR增强现实可应用的场景
Opencascade7.6 compilation
[technology development -21]: rapid overview of the application and development of network and communication technology -1- Internet Network Technology
剑指 Offer 62. 圆圈中最后剩下的数字
MySQL主从延迟问题怎么解决
Query word weight, search word weight calculation
CSDN insertion directory in 1 second
2022 low voltage electrician test question simulation test question bank simulation test platform operation