#鸿蒙通关秘籍#在编辑器中,如何快速在父类和子类之间跳转?

HarmonyOS
2024-12-04 12:26:34
浏览
收藏 0
回答 1
待解决
回答 1
按赞同
/
按时间
SEM幻影舞

通过快捷键Ctrl+Alt+向上/向下箭头(或Cmd+Alt+向上/向下箭头)快速跳转到父/子类。

import { AbilityConstant, ConfigurationConstant, UIAbility, Want, } from '@kit.AbilityKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
import { window } from '@kit.ArkUI';
import wantConstant from '@ohos.ability.wantConstant';


export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
this.context.getApplicationContext().setColorMode(ConfigurationConstant.ColorMode.COLOR_MODE_NOT_SET);
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
}

//
onDestroy(): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
}

onWindowStageCreate(windowStage: window.WindowStage): void {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');

windowStage.loadContent('pages/Index', (err) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
});
}

onWindowStageDestroy(): void {
// Main window is destroyed, release UI related resources
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}

onForeground(): void {
// Ability has brought to foreground
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
}

onBackground(): void {
// Ability has back to background
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
}
}
已于2024-12-19 17:55:29修改
分享
微博
QQ
微信
回复
2024-12-04 12:55:28
相关问题
编辑器异常问题,比如方法跳转失败
705浏览 • 1回复 待解决
如何关闭编辑器自动格式化?
971浏览 • 1回复 待解决
新版DevEco Studio编辑器无法开启模拟
9114浏览 • 2回复 待解决
编辑器编译的时候老是卡在这里很久
742浏览 • 1回复 待解决
新版本的编辑器sdk怎么没有了
198浏览 • 1回复 待解决