#鸿蒙通关秘籍#在编辑器中,我该如何快速跳转到父/子类?

HarmonyOS
2024-12-03 09:24:00
795浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
墨香未央HTML

你可以使用快捷键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');
}
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
已于2024-12-19 18:23:21修改
分享
微博
QQ
微信
回复
2024-12-03 12:04:26
相关问题
编辑器异常问题,比如方法跳转失败
1456浏览 • 1回复 待解决
如何关闭编辑器自动格式化?
1762浏览 • 1回复 待解决
新版DevEco Studio编辑器无法开启模拟
10082浏览 • 2回复 待解决
HarmonyOS 能否跳转到图片编辑功能
537浏览 • 1回复 待解决
新版本的编辑器sdk怎么没有了
896浏览 • 1回复 待解决
编辑器编译的时候老是卡在这里很久
1537浏览 • 1回复 待解决