当前位置: 首页 > news >正文

鸿蒙 DevEco Studio 设置状态栏,调用setWindowSystemBarProperties不生效

参考文章:设置状态栏,调用setWindowSystemBarProperties不生效

我使用 setWindowSystemBarProperties 设置状态栏,不生效。

import window from '@ohos.window';export default {data: {title: 'World'},setSystemBar() {var windowClass = null;window.getTopWindow((err, data) => {windowClass = data;var SystemBarProperties = {statusBarColor: '#ca0522',navigationBarColor: '#0456fa',//以下两个属性从API Version7开始支持isStatusBarLightIcon: true,isNavigationBarLightIcon: false};windowClass.setSystemBarProperties(SystemBarProperties, (err, data) => {if (err) {console.error('Failed to set the system bar properties. Cause: ' + JSON.stringify(err));return;}console.info('Succeeded in setting the system bar properties. Data: ' + JSON.stringify(data));});});}
}

后查阅文档发现api9无法使用,

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

http://www.lryc.cn/news/498061.html

相关文章:

  • Spring03——基于xml的Spring应用
  • 【AIGC半月报】AIGC大模型启元:2024.12(上)
  • 本etcd系列文章补充说明
  • 【新品发布】ESP32-P4开发板 —— 启明智显匠心之作,为物联网及HMI产品注入强劲动力
  • HTML 添加 文本水印
  • 软件无线电安全之GNU Radio基础(下)
  • windows基础
  • hhdb数据库介绍(10-43)
  • JMS和消息中间件:Kafka/RocketMQ
  • 【问题解决】ArcgisGP工具使用GIS模块自动发布图层报错:过渡失败
  • Yocto bitbake and codeSonar
  • gpt-computer-assistant - 极简的 GPT-4o 客户端
  • 中国移动量子云平台:算力并网590量子比特!
  • Vue 3 中的计算属性(Computed Properties)详解
  • AWS S3 权限配置与文件上传下载指南
  • 6. 一分钟读懂“抽象工厂模式”
  • CV(2)-插值和卷积
  • 学习threejs,通过设置纹理属性来修改纹理贴图的位置和大小
  • fastadmin 后台插件制作方法
  • 9. 一分钟读懂“策略模式”
  • 65页PDF | 企业IT信息化战略规划(限免下载)
  • Android 单元测试断言校验方法 org.junit.Assert
  • 亚马逊云(AWS)使用root用户登录
  • 用点云信息来进行监督目标检测
  • Navicat连接服务器MySQL
  • FastAPI 响应状态码:管理和自定义 HTTP Status Code
  • 【人工智能数学基础篇】线性代数基础学习:深入解读矩阵及其运算
  • RNACOS:用Rust实现的Nacos服务
  • JAVA |日常开发中JSTL标签库详解
  • Apache HttpClient 4和5访问没有有效证书的HTTPS