当前位置:网站首页>代码 ~ 隐藏或禁用状态栏和虚拟按键
代码 ~ 隐藏或禁用状态栏和虚拟按键
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
边栏推荐
- Configure vscade to realize ROS writing
- Simple code implementation of decision tree
- Excel拼接数据库语句
- 深入C语言(3)—— C的输入输出流
- Sunflower senior product director technology sharing: "how to apply national remote control" in AD domain environment
- Simple understanding of CDN, SDN and QoS
- Rdkit: introduce smiles code, smart code and Morgan fingerprint (ECFP)
- Deep into C language (1) -- operators and expressions
- Sleuth+zipkin to track distributed service links
- Asynchronous callback future mode of concurrent mode
猜你喜欢

Sunflower senior product director technology sharing: "how to apply national remote control" in AD domain environment

Rongyun real-time community solution

Asynchronous callback future mode of concurrent mode

RHCE's at, crontab's basic operations, the Chrony service, symmetric encryption and asymmetric encryption

ROS - create workspace

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

(codeforce547) c-mike and foam

The latest second edition of comic novels, listening to books, three in one, complete source code / integrated visa free interface / building tutorials / with acquisition interface

Realize multi-level linkage through recursion

(newcoder 15079)无关(容斥原理)
随机推荐
In depth C language (4) -- definition and use of switch
(newcoder 15079) irrelevant (inclusion exclusion principle)
Deep into C language (1) -- operators and expressions
今晚7:30 | 连界、将门、百度、碧桂园创投四位大佬眼中的AI世界,是继续高深还是回归商业本质?...
Practical application cases of digital Twins - smart energy
RTP 发送 和接收 h265
向日葵资深产品总监技术分享:“国民远控”如何在AD域环境下应用
Rdkit: introduce smiles code, smart code and Morgan fingerprint (ECFP)
Singleton and invariant modes of concurrent mode
Introduction to static routing and dynamic routing protocols OSPF and rip and static routing configuration commands
1.5 nn. Module neural network (III)
容斥原理
C obtains JSON format data asynchronously from the web address
I.MX6U-驱动开发-2-LED驱动
HDU多校第二场 1011 DOS Card
(2022杭电多校三)1011-Link is as bear(思维+线性基)
Rdkit II: use rdkit screening to screen 2D pharmacophores of chemical small molecules
实例搭建Flask服务(简易版)
再学EXKMP(EXKMP模板)
Tencent cloud logs in with PEM