我有两个文件:
app.component.ts:
this.threeDeeTouch.isAvailable().then(() => {
const actions: ThreeDeeTouchQuickAction[] = [
{
type: 'someButton1',
title: Hello threre,
iconType: 'play'
},
{
type: 'someButton2',
title: General Kenobi,
iconType: 'compose'
}
];
this.threeDeeTouch.configureQuickActions(actions);
});
somepage.page.ts:
ngOnInit() {
this.threeDeeTouch.isAvailable().then(() => {
this.threeDeeTouch.onHomeIconPressed().subscribe(
(payload) => {
switch (payload.type) {
case 'someButton1':
this.myFunction();
break;
case 'someButton2':
this.anotherFunction();
break;
}
}
);
});
}
按钮在我的测试设备上可见并且可以单击,但是单击后,应用程序仅在不调用函数的情况下启动。有人可以解决这个问题吗?
感谢您的帮助:)