android - Galaxy S10、S10+ 全屏模式

标签 android fullscreen samsung-mobile android-fullscreen samsung-galaxy

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

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
);

它隐藏了状态栏的内容,但它并没有隐藏它自己的状态栏:(

请帮忙

最佳答案

以您的应用程序的样式为我解决以下问题:

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

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

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

关于android - Galaxy S10、S10+ 全屏模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55130940/

相关文章:

android - FFmpeg 从视频中提取帧

java - 单一异常

android - 在 OpenGL ES 中渲染期间编译着色器是一种好的/有效的做法吗?

在三星默认浏览器上测试网站

android - 选项菜单锁定在 galaxy s4 上

android - 在所有 Activity 中显示通用音乐播放器

android - 具有 Windows NTLM 身份验证的 Office-365-SDK-for-Android

jquery - 使用 HTML5 视频标签退出全屏

flash - 允许 Silverlight(和 Flash)应用保持全屏

javascript - 全屏菜单淡入淡出不适用于 svg 和图像