当前位置: 首页> 汽车> 新车 > 注册公司没有地址怎么解决_微信怎样开通公众号_长春做网站推广的公司_产品宣传方案

注册公司没有地址怎么解决_微信怎样开通公众号_长春做网站推广的公司_产品宣传方案

时间:2025/7/29 13:08:14来源:https://blog.csdn.net/qq_44402184/article/details/142165664 浏览次数: 0次
注册公司没有地址怎么解决_微信怎样开通公众号_长春做网站推广的公司_产品宣传方案

请添加图片描述

👨🏻‍💻 热爱摄影的程序员
👨🏻‍🎨 喜欢编码的设计师
🧕🏻 擅长设计的剪辑师
🧑🏻‍🏫 一位高冷无情的全栈工程师
欢迎分享 / 收藏 / 赞 / 在看!

要在 HarmonyOS 中实现自定义启动页,需要在项目中 Ability 的 onWindowStageCreate 和 onWindowStageRestore 方法中获取应用主窗口, 并通过调用窗口强制全屏布局接口 setWindowLayoutFullScreen 将窗口设置为全屏。

/*** 将窗口设置为全屏* @param windowStage*/
setFullSize(windowStage: window.WindowStage) {let windowClass: window.Window = windowStage.getMainWindowSync(); // 获取应用主窗口// 设置窗口全屏let isLayoutFullScreen = true;windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).then(() => {console.info('Succeeded in setting the window layout to full-screen mode.');}).catch((err: BusinessError) => {console.error('Failed to set the window layout to full-screen mode. Cause:' + JSON.stringify(err));});
}

新建启动页 Splash.ets ,在该页面中的 aboutToAppear 生命周期钩子中使用 timer 定时器,实现延时跳转功能。最后在组件结构销毁之前的 aboutToDisappear 生命周期钩子中销毁 timer 定时器。

@State countdown: number = 5; // 倒计时,默认 5 秒
readonly DURATION: number = 1000; // 倒计时间隔
private timer: number = 0; // 定时器aboutToAppear(): void {this.startTiming();
}/*** 开始倒计时*/
startTiming() {// 设置时间间隔this.timer = setInterval(() => {this.countdown--;if (this.countdown === 0) {this.clearTiming();this.jumpToMainPage();}}, this.DURATION);
}/*** 清除定时器*/
clearTiming() {if (this.timer !== null) {clearInterval(this.timer);this.timer = 0;}
}/*** 跳转到主页*/
jumpToMainPage() {this.clearTiming();router.replaceUrl({url: 'pages/Index'});
}/*** 组件结构销毁之前时*/
aboutToDisappear() {// 清除定时器this.clearTiming();
}

运行效果如下:

在这里插入图片描述

关键字:注册公司没有地址怎么解决_微信怎样开通公众号_长春做网站推广的公司_产品宣传方案

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: