一聚教程网:一个值得你收藏的教程网站

热门教程

HarmonyOS 6(API 23)实战-PC端AI智能体沉浸

时间:2026-08-30 19:46:51 编辑:袖梨 来源:一聚教程网

HarmonyOS适合从架构、配置和使用边界三处入手判断,避免把概念和实际流程混在一起。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

通过 setWindowLayoutFullScreen(true) 移除系统标题栏,配合 expandSafeArea 扩展安全区至全屏,最大化态势展示区域;另外注册窗口焦点变化监听,实现"焦点即光效"的感知降级——当窗口失焦时自动降低背景光效强度,减少干扰;TypeScript // entry/src/main/ets/entryability/EntryAbility.etsimport { AbilityConstant, UIAbilit。import { window } from '@kit.ArkUI';import { LightEffectManager } from '../services/LightEffectManager';export default class EntryAbility extends UIAbility {private mainWindow: window.Window | n。private lightManager: LightEffectManager | null = null;// 全屏沉浸配置await this.mainWindow.setWindowLayoutFullScreen(true);await this.mainWindow.setWindowSystemBarEnable([])。

在这里插入图片描述

热门栏目