当前位置:网站首页>代码 ~ 隐藏或禁用状态栏和虚拟按键
代码 ~ 隐藏或禁用状态栏和虚拟按键
2022-07-29 03:39:00 【南柯好萌】
themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.NavigationBarSample" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> <!-- Primary brand color. --> <item name="colorPrimary">@color/purple_500</item> <item name="colorPrimaryVariant">@color/purple_700</item> <item name="colorOnPrimary">@color/white</item> <!-- Secondary brand color. --> <item name="colorSecondary">@color/teal_200</item> <item name="colorSecondaryVariant">@color/teal_700</item> <item name="colorOnSecondary">@color/black</item> <!-- Status bar color. --> <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item> <!-- Customize your theme here. --> <item name="android:windowFullscreen">true</item> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="android:navigationBarColor">#88000000</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> </style>
</resources>
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
decorView.setSystemUiVisibility(uiOptions);
setContentView(R.layout.activity_main);
}
}
参考:
https://www.jcodecraeer.com/a/anzhuokaifa/developer/2014/1117/1997.html
边栏推荐
- Producer consumer model of concurrent model
- 深入C语言(1)——操作符与表达式
- Machine learning [numpy]
- Shutter start white screen
- 腾讯云使用pem登录
- 3.1 common neural network layer (I) image correlation layer
- Asynchronous callback future mode of concurrent mode
- Whole process record of yolov3 target detection
- RTP 发送 和接收 h265
- Tonight at 7:30 | is the AI world in the eyes of Lianjie, Jiangmen, Baidu and country garden venture capital continue to be advanced or return to the essence of business
猜你喜欢

Rdkit I: using rdkit to screen the structural characteristics of chemical small molecules

实例搭建Flask服务(简易版)

今晚7:30 | 连界、将门、百度、碧桂园创投四位大佬眼中的AI世界,是继续高深还是回归商业本质?...

AI_ Drug: VAE of molecular generation model (I)
![[technology 1]](/img/eb/63baf1ae3931a156a0a5b377a9b7d1.jpg)
[technology 1]

04 | background login: login method based on account and password (Part 1)

Bingbing learning notes: operator overloading -- implementation of date class

Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP

向日葵远程控制为何采用BGP服务器?自动最优路线、跨运营商高速传输

ROS-Errror:Did you forget to specify generate_ messages(DEPENDENCIES ...)?
随机推荐
Introduction and comparison of unicast, multicast (target broadcast, multicast), broadcast, flooding, flooding
Leetcode 1331 array sequence number conversion [map] the leetcode path of heroding
Deep into C language (1) -- operators and expressions
Introduction to JVM foundation I (memory structure)
AI_ Drug: VAE of molecular generation model (I)
Target detection, industrial defects, image segmentation -- deep learning data set induction
向日葵远程控制为何采用BGP服务器?自动最优路线、跨运营商高速传输
(newcoder 15079)无关(容斥原理)
The difference between /g /m /i of JS regular expressions
Multi level wavelet CNN for image restoration
Inclusion exclusion principle
Kotlin companion object vs global function
深入C语言(1)——操作符与表达式
Military product development process - transition phase
Understanding of p-type problems, NP problems, NPC problems, and NP hard problems in natural computing
数字孪生实际应用案例-智慧能源篇
Excel拼接数据库语句
C obtains JSON format data asynchronously from the web address
ROS - create workspace
How close can QA be to business code QA conducts testability transformation on business code