我想在phonegap應用程序的splashscreen上顯示祝酒。烤麪包應該與閃屏一起顯示,而不是之後。需要調用一個函數,同時在Phonegap中的飛濺屏幕
2
A
回答
2
有趣的問題和一個好主意,以顯示其他信息。我只是做了一個測試,它的工作原理是使用這個插件:
https://www.npmjs.com/package/cordova-plugin-splashscreen
https://www.npmjs.com/package/cordova-plugin-x-toast
科爾多瓦deviceready事件後,只要致電:
navigator.splashscreen.show();
,然後你的麪包,在這裏從文檔中取出示例:
window.plugins.toast.showWithOptions(
{
message: "hey there",
duration: "short",
position: "bottom",
addPixelsY: -40, // (optional) added a negative value to move it up a bit (default 0)
data: {} // (optional) pass in a JSON object here (it will be sent back in the success callback below)
},
// implement the success callback
function(result) {
if (result && result.event) {
console.log("The toast was tapped");
console.log("Event: " + result.event); // will be defined, with a value of "touch" when it was tapped by the user
console.log("Message: " + result.message); // will be equal to the message you passed in
console.log("data.foo: " + result.data.foo); // .. retrieve passed in data here
} else {
console.log("The toast has been shown");
}
}
);
0
這樣做的最簡單的方法是將吐司代碼保留在設備就緒功能中。因此,當應用程序啓動時,消息將沿着閃屏顯示。
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// write your code here
}
相關問題
- 1. WPF飛濺屏幕,如何使飛濺屏幕顯示更長
- 2. 飛濺屏幕上的Videoview
- 3. 在Java中的飛濺屏幕
- 4. 爲Default.png飛濺屏幕(iphone)
- 5. 延時窗口飛濺屏幕
- 6. 使用Phonegap創建自動隱藏的飛濺屏幕
- 7. WPF使用ProgressBar的飛濺屏幕
- 8. 飛濺微調在PhoneGap的2.4
- 9. Ionic2飛濺屏幕不顯示飛濺圖標
- 10. 用戶控件WPF飛濺屏幕
- 11. C#Winforms - 飛濺屏幕掛在Form_Load
- 12. 飛濺屏幕動畫像在android
- 13. 在飛濺之前添加屏幕
- 14. 在飛濺屏幕上顯示Toast Android
- 15. Phonegap -Android--飛濺屏幕的替代高度
- 16. 飛濺屏幕的Android Transition圖像(TransitionDrawable)
- 17. 飛濺屏幕的離子動畫
- 18. 顯示類似飛濺的屏幕JQuery
- 19. 飛濺屏幕不能正常工作
- 20. 帶矢量拉伸全屏幕的飛濺屏幕
- 21. Fadout飛濺屏幕上的多個圖像在IOS
- 22. 飛濺屏幕顯示爲空白屏幕
- 23. 如何爲飛濺屏幕添加不同的圖像
- 24. 屏幕之間的飛濺屏幕和webview之間的空白屏幕iOS
- 25. 從Visual Studio中的飛濺屏幕操作不起作用(WPF)
- 26. 在android中的飛濺屏幕不工作
- 27. 應用程序在飛濺屏幕4.0崩潰
- 28. 我如何將默認圖片放在android中? (飛濺屏幕)
- 29. 視頻飛濺不在屏幕中心 - Android Studio
- 30. 飛濺屏幕直角座標返回在Win 10 Mobile上的屏幕尺寸
我嘗試過更好,更簡單的方法。請在下面找到我的答案。 –