单手抓螃蟹 2021-05-15 22:52 采纳率: 12.5%
浏览 18
已结题

安卓开发——系统UI

现在安卓主流的屏下摄像头,或者水滴屏的手机

为什么设置了全屏之后状态栏就变黑了,

怎么样才能设置成沉浸式的全屏模式呢

  • 写回答

1条回答 默认 最新

  • Shixfer 2024-05-20 17:48
    关注

    隐藏insets

    private void hideStatusBar() {
        WindowInsetsController windowInsetsController = getWindow().getDecorView().getWindowInsetsController();
        assert windowInsetsController != null;
        windowInsetsController.hide(WindowInsets.Type.statusBars());
    }
    
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 8月3日