Galaxy S10,S10 +全屏模式

Moh*_*our 2 android fullscreen samsung-mobile android-fullscreen samsung-galaxy

如何使用Samsung 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
);
Run Code Online (Sandbox Code Playgroud)

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

请帮忙

Moh*_*our 5

在您的应用样式中,以下内容为我解决了此问题:

<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
Run Code Online (Sandbox Code Playgroud)

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

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