Galaxy S10,S10 +全屏模式 [英] Galaxy S10, S10+ Full Screen Mode

查看:359
本文介绍了Galaxy S10,S10 +全屏模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Samsung Galaxy S10和S10 +实现全屏模式,以下代码对我不起作用:

How can achieve full screen mode with Samsung Galaxy S10 and S10+, the following code do not work for me:

getWindow().getDecorView().setSystemUiVisibility(
// Set the content to appear under the system bars so that the
// content doesn't resize when the system bars hide and show.
SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
// Hide the nav bar and status bar
// | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
);

它隐藏状态栏的内容,但不会隐藏状态栏本身:(

It hide the content of the status bar but it doesn't hide the status bar it self :(

请帮助

推荐答案

将样式设置为应用以下为我解决了这个问题:

Put in the style of your app the following fixed this issue for me:

<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>

有关支持抠图的更多详细信息,请参见:

For more details about supporting cutout look at this:

https://developer.android.com/guide/topics/display-cutout

这篇关于Galaxy S10,S10 +全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆