当前位置:网站首页>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);
边栏推荐
- Advanced Algebra _ Proof _ Any matrix is similar to an upper triangular matrix
- VOT2021 game introduction
- The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
- 简单的vim配置
- Weekly Summary
- Basic use of vim - bottom line mode
- SQL注入 Less38(堆叠注入)
- Pylint检查规则中文版
- Interview assault 69: TCP reliable?Why is that?
- zeno使用方法笔记
猜你喜欢
Interview assault 69: TCP reliable?Why is that?
Daily--Kali opens SSH (detailed tutorial)
编译型语言和解释型语言的区别
[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories
Network security - crack WiFi through handshake packets (detailed tutorial)
Shell常用脚本:Nexus批量上传本地仓库脚本
数据分析(一)——matplotlib
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation
What is customer profile management?
NIO programming
随机推荐
基于simulink的Passive anti-islanding-UVP/OVP and UFP/OFP被动反孤岛模型仿真
[Reading Notes -> Data Analysis] 02 Data Analysis Preparation
Shell常用脚本:Nexus批量上传本地仓库增强版脚本(强烈推荐)
Recommendation system: Summary of common evaluation indicators [accuracy rate, precision rate, recall rate, hit rate, (normalized depreciation cumulative gain) NDCG, mean reciprocal ranking (MRR), ROC
I don't know what to do with sync issues
如何撰写出一篇优质的数码类好物推荐文
IPD流程专业术语
一文概述:VPN的基本模型及业务类型
Handwritten a simple web server (B/S architecture)
浏览器下载快捷方式到桌面(PWA)
编写方法将一个数组扁平化并且去重和递增排序
数据分析(一)——matplotlib
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
SQL injection Less42 (POST type stack injection)
无状态与有状态的区别
@JsonFormat(pattern=“yyyy-MM-dd“)时间差问题
The difference between /usr/local/bin and /usr/bin
[Cloud Residency Co-Creation] [HCSD Big Celebrity Live Broadcast] Personally teach the secrets of interviews in big factories
一行代码解决CoreData托管对象属性变更在SwiftUI中无动画效果的问题
如何设计高可用高性能中间件 - 作业