实现游戏沉浸式效果
实现游戏沉浸式效果,底部上滑才会出现虚拟按键和手势引导。
getWindow().setDecorFitsSystemWindows(false);
WindowInsetsController windowInsetsController = getWindow().getInsetsController();
windowInsetsController.hide(WindowInsets.Type.systemBars());
windowInsetsController.setSystemBarsBehavior(WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE);
参考链接:
https://developer.android.google.cn/develop/ui/views/layout/immersive?hl=zh-cn#kotlin
https://blog.csdn.net/lzs781/article/details/127972376

浙公网安备 33010602011771号