当前位置:网站首页>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);
边栏推荐
- Decipher the AI black technology behind sports: figure skating action recognition, multi-mode video classification and wonderful clip editing
- Start from scratch - Web Host - 01
- Sword finger offer 29 Print matrix clockwise
- 【深度学习】infomap 人脸聚类 facecluster
- Design and implementation of key value storage engine based on LSM tree
- Ar Augmented Reality applicable scenarios
- Build a modern data architecture on the cloud with Amazon AppFlow, Amazon lake formation and Amazon redshift
- Pytest testing framework
- Query word weight, search word weight calculation
- leetcode2305. 公平分发饼干(中等,周赛,状压dp)
猜你喜欢

LFM信号加噪、时频分析、滤波

Word search applet design report based on cloud development +ppt+ project source code + demonstration video

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

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

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

Software development life cycle -- waterfall model

pytest 测试框架

query词权重, 搜索词权重计算

CVPR 2022 | 大连理工提出自校准照明框架,用于现实场景的微光图像增强

MySQL约束与多表查询实例分析
随机推荐
Sword finger offer 62 The last remaining number in the circle
2022 Q2 - Summary of skills to improve skills
Deep learning: a solution to over fitting in deep neural networks
AR增强现实可应用的场景
oracle创建只读权限的用户简单四步走
Kibana操控ES
Construction and maintenance of business websites [12]
【读书笔记】程序员修炼手册—实战式学习最有效(项目驱动)
Opencascade7.6 compilation
Design and implementation of key value storage engine based on LSM tree
What style of Bluetooth headset is easy to use? High quality Bluetooth headset ranking
Iterative unified writing method of binary tree
[question] - why is optical flow not good for static scenes
If you want to rewind the video picture, what simple methods can you use?
How to turn off the LED light of Rog motherboard
Start from scratch - Web Host - 01
大厂裁员潮不断,双非本科出身的我却逆风翻盘挺进阿里
Logging only errors to the console Set system property ‘log4j2. debug‘ to sh
Flutter un élément au milieu, l'élément le plus à droite
leetcode2305. Fair distribution of biscuits (medium, weekly, shaped pressure DP)