当前位置:网站首页>WindowInsetsControllerCompat is simple to use
WindowInsetsControllerCompat is simple to use
2022-08-01 00:02:00 【Dongdongxu huster】
WindowInsetsControllerCompat, which can be mainly used to control the display of navigation bar, status bar, keyboard, etc. in the interface. There are probably the following types.
WindowInsetsCompat.Type.statusBars()WindowInsetsCompat.Type.navigationBars()WindowInsetsCompat.Type.captionBar()WindowInsetsCompat.Type.ime()WindowInsetsCompat.Type.systemGestures()WindowInsetsCompat.Type.mandatorySystemGestures()WindowInsetsCompat.Type.tappableElement()WindowInsetsCompat.Type.displayCutout()WindowInsetsCompat.Type.systemBars()
Import dependencies
implementation 'androidx.core:core:1.5.0-beta03'
How to use
WindowInsetsControllerCompat insetsController = ViewCompat.getWindowInsetsController(getWindow().getDecorView());// Hide the status bar, navigation bar, title barinsetsController.hide(WindowInsetsCompat.Type.systemBars());// Display the status bar, navigation bar, title barinsetsController.show(WindowInsetsCompat.Type.systemBars());// hide the navigation barinsetsController.hide(WindowInsetsCompat.Type.navigationBars());// show the navigation barinsetsController.show(WindowInsetsCompat.Type.navigationBars());// show the status barinsetsController.show(WindowInsetsCompat.Type.statusBars());// hide the status barinsetsController.hide(WindowInsetsCompat.Type.statusBars());// show the keyboardinsetsController.show(WindowInsetsCompat.Type.ime());// hide the keyboardinsetsController.hide(WindowInsetsCompat.Type.ime());// ...// Control the font color of the status bar to display whiteinsetsController.setAppearanceLightStatusBars(false);// Control the navigation bar font to be displayed in blackinsetsController.setAppearanceLightStatusBars(true);// Navigation bar color is whiteinsetsController.setAppearanceLightNavigationBars(false);// The navigation bar is displayed in blackinsetsController.setAppearanceLightNavigationBars(true);
边栏推荐
- 什么时候可以使用 PushGateway
- Daily--Kali opens SSH (detailed tutorial)
- 继承的注意事项
- Matlab / ArcGIS 处理GPM全球月均降水数据
- Google Earth Engine——Error: Image.clipToBoundsAndScale, argument ‘input‘: Invalid type的错误解决
- MySQL数据库‘反斜杠\’ ,‘单引号‘’,‘双引号“’,‘null’无法存储
- date命令
- 南方科技大学:Xiaoying Tang | AADG:视网膜图像分割领域泛化的自动增强
- (26) About menu of the top menu of Blender source code analysis
- SQL injection Less54 (limited number of SQL injection + union injection)
猜你喜欢
随机推荐
面试突击69:TCP 可靠吗?为什么?
NIO programming
[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories
【Acwing】The 62nd Weekly Game Solution
开源好用的 流程图绘制工具 drawio
I don't know what to do with sync issues
2022年CSP-J1 CSP-S1 第1轮初赛 报名指南
SQL injection Less54 (limited number of SQL injection + union injection)
Shell common scripts: Nexus batch upload local warehouse enhanced version script (strongly recommended)
程序进程和线程(线程的并发与并行)以及线程的基本创建和使用
Thinking and Implementation of Object Cache Service
10大主流3D建模技术
类和对象:中
How to Design High Availability and High Performance Middleware - Homework
【读书笔记->数据分析】02 数据分析准备
LeetCode 第 304 场周赛
博弈论(Depu)与孙子兵法(42/100)
date命令
TFC CTF 2022 WEB Diamand WriteUp
[QNX Hypervisor 2.2用户手册]9.15 suppress