当前位置:网站首页>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);
边栏推荐
- [liuyubobobo play with leetcode algorithm interview] [00] Course Overview
- [technology development -21]: rapid overview of the application and development of network and communication technology -1- Internet Network Technology
- Regular expression learning notes
- STM32F103 - two circuit PWM control motor
- [reading notes] programmer training manual - practical learning is the most effective (project driven)
- Construction and maintenance of business websites [15]
- Types of exhibition items available in the multimedia interactive exhibition hall
- JVM interview
- RTL8189FS如何关闭Debug信息
- leetcode2312. 卖木头块(困难,周赛)
猜你喜欢
Sword finger offer 62 The last remaining number in the circle
【liuyubobobo-玩转Leetcode算法面试】【00】课程概述
[liuyubobobo play with leetcode algorithm interview] [00] Course Overview
leetcode2309. The best English letters with both upper and lower case (simple, weekly)
The basic steps of using information theory to deal with scientific problems are
JPM 2021 most popular paper released (with download)
Word search applet design report based on cloud development +ppt+ project source code + demonstration video
研发中台拆分过程的一些心得总结
leetcode2312. Selling wood blocks (difficult, weekly race)
MySQL operates the database through the CMD command line, and the image cannot be found during the real machine debugging of fluent
随机推荐
LFM signal denoising, time-frequency analysis, filtering
leetcode2312. Selling wood blocks (difficult, weekly race)
Infix expression to suffix expression (computer) code
STM32F103——两路PWM控制电机
JS slow animation
Opencascade7.6 compilation
Architecture evolution from MVC to DDD
[C #] use regular verification content
query词权重, 搜索词权重计算
JPM 2021 most popular paper released (with download)
How to turn off the LED light of Rog motherboard
Bash bounce shell encoding
Flutter un élément au milieu, l'élément le plus à droite
Architecture evolution from MVC to DDD
MySQL中一条SQL是怎么执行的
剑指 Offer 47. 礼物的最大价值
【OpenCV】-5种图像滤波的综合示例
[reading notes] programmer training manual - practical learning is the most effective (project driven)
LeetCode刷题(十)——顺序刷题46至50
【毕业季】研究生学长分享怎样让本科更有意义