鸿蒙Harmony 设置状态栏颜色

    @Override
    public void onStart(Intent intent) {
        Window window = getWindow();
        window.setStatusBarColor(Color.BLACK.getValue());
        window.setStatusBarVisibility(Component.VISIBLE);
        super.onStart(intent);
        super.setMainRoute(MainAbilitySlice.class.getName());
    }

setStatusBarColor 与 setStatusBarVisibility 要配合使用哦

Gitee 鸿蒙应用开发示例
https://gitee.com/liukerui/harmony-app-examples.git

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐