当前位置:网站首页>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);
边栏推荐
- Sword finger offer 29 Print matrix clockwise
- Query word weight, search word weight calculation
- LeetCode刷题(十)——顺序刷题46至50
- 【读书笔记】程序员修炼手册—实战式学习最有效(项目驱动)
- AR增强现实可应用的场景
- 离婚3年以发现尚未分割的共同财产,还可以要么
- Deep learning: a solution to over fitting in deep neural networks
- WebGPU(一):基本概念
- [learn C and fly] day 5 chapter 2 program in C language (Exercise 2)
- C # use system data. The split mixed mode assembly is generated for the "v2.0.50727" version of the runtime, and it cannot be loaded in the 4.0 runtime without configuring other information
猜你喜欢

Comparative analysis of MVC, MVP and MVVM, source code analysis
![[graduation season] graduate seniors share how to make undergraduate more meaningful](/img/03/9adc44476e87b2499aa0ebb11cb247.png)
[graduation season] graduate seniors share how to make undergraduate more meaningful

Which is a good Bluetooth headset of about 300? 2022 high cost performance Bluetooth headset inventory

leetcode2310. 个位数字为 K 的整数之和(中等,周赛)

软件开发生命周期 --瀑布模型

MySQL constraints and multi table query example analysis

WebGPU(一):基本概念

Deployment practice and problem solving of dash application development environment based on jupyter Lab

leetcode2305. 公平分发饼干(中等,周赛,状压dp)

How to turn off the LED light of Rog motherboard
随机推荐
[learn C and fly] day 5 chapter 2 program in C language (Exercise 2)
2022安全员-C证考试题及模拟考试
What is the function of the headphone driver
附加:信息脱敏;
MySQL operates the database through the CMD command line, and the image cannot be found during the real machine debugging of fluent
Calculation (computer) code of suffix expression
Software testing learning notes - network knowledge
【带你学c带你飞】2day 第8章 指针(练习8.1 密码开锁)
2022 Q2 - Summary of skills to improve skills
leetcode2305. 公平分发饼干(中等,周赛,状压dp)
Pat a-1165 block reversing (25 points)
Learning notes of software testing -- theoretical knowledge of software testing
Design and implementation of key value storage engine based on LSM tree
Pytest testing framework
大厂裁员潮不断,双非本科出身的我却逆风翻盘挺进阿里
flutter 中間一個元素,最右邊一個元素
【毕业季】研究生学长分享怎样让本科更有意义
Email picture attachment
Divorce for 3 years to discover the undivided joint property, or
leetcode373. 查找和最小的 K 对数字(中等)