简体   繁体   English

Android上的Cocos2d-x游戏会忽略首次点击

[英]Cocos2d-x game on Android ignores first tap

I'm developing a game using Cocos2d-x 3.12. 我正在使用Cocos2d-x 3.12开发游戏。 On Android (tried devices with API version 15 and 18), it runs fine, but when it's started, or when it's sent to background then foreground, the first tap on the screen is ignored, with the following message in the log: 在Android(使用API​​版本15和18的试用设备)上,它运行良好,但是当它启动时,或者当它先发送到后台又发送到前台时,将忽略屏幕上的第一次点击,并在日志中显示以下消息:

I/InputQueue-JNI(16547): Sending finished signal for input channel 'hidden nav (client)' since it is being unregistered while an input message is still in progress.
I/InputQueue-JNI(16547): Ignoring finish signal on channel that is no longer registered.

The taps after that work ok. 之后的水龙头工作正常。

It's a problem because I expect the app to respond the first time when I interact with it. 这是一个问题,因为我希望该应用在与之交互时会在第一时间响应。 Has anybody else encountered this problem? 还有其他人遇到过这个问题吗?

Apparently this behavior was happening because the main View had the flag View.SYSTEM_UI_FLAG_HIDE_NAVIGATION set on it, so the first tap brought the system navigation back. 显然是因为主视图上已设置了标志View.SYSTEM_UI_FLAG_HIDE_NAVIGATION ,所以发生了此行为,因此第一次点击就使系统导航返回。 A solution more proper to my game was to just set the View.SYSTEM_UI_FLAG_LOW_PROFILE flag, so the system navigation is visible but dimmed. 一个更适合我的游戏的解决方案是只设置View.SYSTEM_UI_FLAG_LOW_PROFILE标志,以便系统导航可见但变暗。

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

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