简体   繁体   English

Phonegap画布无法在Android上绘制,但在浏览器中可以正常工作

[英]Phonegap canvas not drawing on android but works fine in browser

I've made a simple HTML5 noughts and crosses(tic tac toe) game that uses the canvas element and I am trying to use phonegap to get it working on Android. 我制作了一个使用canvas元素的简单HTML5棋盘游戏(井字游戏),并且我试图使用phonegap使其在Android上正常工作。 I've test it works fine on firefox, chrome and internet explorer but when I get built using phonegap the apk produced simply renders a white screen. 我已经测试了它在Firefox,Chrome和Internet Explorer上的正常运行,但是当我使用phonegap构建时,生成的apk只会呈现白色屏幕。

I've tried using the ripple emulator and it renders and behaves as expected fine. 我试过使用波纹模拟器,它可以呈现并表现出预期的效果。 Really confused as to why its not working. 关于它为什么不起作用真的很困惑。

To work on pc instead of phoengap you have to change document.addEventListener("deviceready",onDeviceReady, false); 要在PC上工作而不是phoengap,必须更改document.addEventListener("deviceready",onDeviceReady, false); to document.addEventListener("DOMContentLoaded",onDeviceReady, false); document.addEventListener("DOMContentLoaded",onDeviceReady, false);

in main.js. 在main.js中。

I am using fast-canvas as a plugin, see the config file. 我使用快速画布作为插件,请参阅配置文件。 Code is avaliable here as well as assets here: https://github.com/JacobRawling/XandOs Please help I am very confused and am struggling to find any phonegap tutorials that use canvas. 代码在这里可用,在这里也可以使用: https : //github.com/JacobRawling/XandOs请帮助我,我非常困惑,并且正在努力寻找使用画布的所有phonegap教程。

Thanks very much 非常感谢

Your solution is jqscribble – A touch enabled canvas drawing tool 您的解决方案是jqscribble –具有触摸功能的画布绘制工具

http://plugins.jquery.com/jqscribble/ http://plugins.jquery.com/jqscribble/

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

相关问题 Facebook登录在浏览器中工作正常,但在带phonegap的android上不起作用 - Facebook login works fine in browser but doesn't work on android with phonegap HTML5 canvas在桌面浏览器上工作正常,但在Android上工作不正常 - HTML5 canvas works fine on desktop browser but not on Android Android浏览器中的画布绘制不一致 - Inconsistent canvas drawing in Android browser cordova(phonegap):在画布内拖动图像在浏览器中工作正常,但在移动设备中不能正常工作 - cordova(phonegap): drag image inside canvas working fine in browser but not in mobile 画布在移动设备上不起作用,在桌面上工作正常 - Drawing canvas not working on mobile devices, works fine on desktop Android XmlHttpRequest上的Phonegap可在模拟器和浏览器中使用,而不是在设备上使用 - Phonegap on Android XmlHttpRequest Works in Emulator & browser, Not on Device Android Native Browser复制HTML5画布(镀铬质量好) - Android Native Browser duplicating HTML5 canvas (fine in chrome) 在画布上绘制圆环时出现错误,在外部功能正常 - Error drawing a circle on canvas when its in a function,works fine outside function Express session 不在 ios/safari 浏览器上存储 cookies,但在 android 上工作正常 - Express session not storing cookies on ios/safari browser, but works fine on android 将Canvas绘图保存在html5 phonegap中 - save Canvas drawing in html5 phonegap
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM