简体   繁体   English

如何在手机缝隙中弹出

[英]How to create pop up in phone gap

Helo, Is there a possibility to click on button and show a popupover and inside it there is two buttons. 嗨,有没有可能单击按钮并显示一个弹出窗口,并且在其中有两个按钮。 When i click on each of them , i have an alert. 当我单击它们时,我会收到警报。 If there isn't a possibility with a popupover is there a possibilty of any other popup window? 如果不可能出现弹出窗口,那么是否有其他弹出窗口的可能性? My Android application is developped in phonegap Thanks a lot 我的Android应用程序已在phonegap中开发非常感谢

Take a look at the cordova dialogue api. 看看Cordova对话API。

https://github.com/apache/cordova-plugin-dialogs/blob/master/doc/index.md https://github.com/apache/cordova-plugin-dialogs/blob/master/doc/index.md

I think you are looking for the navigator.notification.confirm feature. 我认为您正在寻找navigator.notification.confirm功能。

Using this feature you can display a popup with multiple options for the user to tap on. 使用此功能,您可以显示一个带有多个选项的弹出窗口,供用户点击。

The index of the button the user taps on is returned to the confirmCallback, so you can handle the user input. 用户点击的按钮的索引返回到ConfirmCallback,因此您可以处理用户输入。

navigator.notification.confirm(message, onConfirm, [button1], [button2]); navigator.notification.confirm(message,onConfirm,[button1],[button2]);

function onConfirm(buttonIndex) {
    alert('You selected button ' + buttonIndex);
}

perform operations based on buttonIndex. 根据buttonIndex执行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM