横屏输入法文字显示不全的bug

小游戏 企业微信 微信支付 小程序 文章 2020-07-30 20:37 1164 0 全屏看文

AI助手支持GPT4.0

横屏输入法文字显示不全的bug

在游戏中要用到改昵称的功能

可以使用showKeyboard调出输入法

但是横屏的时候输入的文本怎么显示不全?这是不是bug?

没办法只能自己处理了,经过测试发现在文字前边加5个空格正好能显示出来。

所以在onKeyboardInput里加上5个空格就可以了

onKeyboardConfirm里再把5个空格去掉就好了

这样可以说解决了显示不全的bug。但是会产生一个副作用。就是没有输入法的联想功能,猜测可能在调用 updateKeyboard时清了联想状态。

如果是bug希望微信来解决吧。毕竟我这种方式只是一种替代方案。


If you want to use the function of changing the nickname in the game, you can use showkeyboard to call up the input method, but how can the input text not be displayed completely when the horizontal screen is displayed? Is this a bug? I can't help but deal with it by myself. After testing, it is found that adding 5 spaces before the text just shows up. So add 5 spaces in onkeyboard input and remove 5 more spaces in onkeyboard confirm, which can be said to solve the problem of incomplete display. But there's a side effect. There is no association function of the input method. It is speculated that the association state may be cleared when the updatekeyboard is called. If it's a bug, I hope wechat can solve it. After all, my approach is just an alternative.

回答:

小游戏运营专员-宏:

你好,具体是什么机型?能否提供个可复现的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

李伟:

机型:小米8

左侧有刘海的时候出现的

输入法界面适配了刘海,但是最上边输入框没有适配刘海

如果转下手机。让刘海在右边。那输入框是没有问题的。

Forever:能否提供截图?
李伟:可以看到上边的输入显示和下边是没有对齐的。因为我有刘海。所以下边显示是正常的。上边输入框里显示的字符为 “     地宫传奇”
前边放了5个空格

-EOF-

AI助手支持GPT4.0