CCEditBox,在android上用户体验太差了,自己做程序的觉得那样输入还可以,不过程序上线以后,好多用户反应,注册的时候,输入完以后就没发操作了,因为在android上用户必须点击右下脚的回车在能收回键盘,后来用CCTextFieldTTF,却发现没右光标,体验还是不好,
现在只是增加了光标以及点击空白区域收回键盘。以及增加了键盘出现消失的通知。
android上现在接受不到通知,暂时不知道怎么搞,希望各位朋友帮着完善下。
.android 上需要修改,cocos2dx 的
EAGLView
增加方法existNeedHiddenkeyboardShow
-(BOOL)existNeedHiddenkeyboardShow
{
NSArray *subviews = self.subviews;
for(UIView* view in subviews)
{
if(isKindOfClass:NSClassFromString(@“CustomUITextField”)])
{
if (isFirstResponder])
{
resignFirstResponder];
return true;
}
}
}
return false;
}
修改touchesBegan
-
(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if (isKeyboardShown_)
{
BOOL existKeyBoard=self existNeedHiddenkeyboardShow];
if (existKeyBoard) {
return;
}}
修改touchesend
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
if (isKeyboardShown_)
{
//return;
}