Had the same issue - the solution is to stop the opengl layer from rendering while this is happening. Here’s what I did:

1) Register for keyboard frame change events at start of application. I did this in AppController.mm

- (BOOL)application:(UIApplication
*)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

...

[[NSNotificationCenterdefaultCenter]
addObserver:self

selector:@selector(keyboardWillChangeFrame:)

name:UIKeyboardWillChangeFrameNotification

object:nil];//UIKeyboardWillChangeFrameNotification

[[NSNotificationCenterdefaultCenter]
addObserver:self

selector:@selector(keyboardDidChangeFrame:)

name:UIKeyboardDidChangeFrameNotification

object:nil];




...

}

2) Started and stopped rendering during keyboard animation.

-(void)keyboardWillChangeFrame:(NSNotification *)notification {

NSLog(@"keyboardWillChangeFrame");

// stop openGL animation while animating keyboard

cocos2d::CCDirector::sharedDirector()->stopAnimation();

}

-(void)keyboardDidChangeFrame:(NSNotification *)notification {// restart openGL animation
when keyboard stops animating

cocos2d::CCDirector::sharedDirector()->startAnimation();

}

上面是从google上搜出来的答案,百度找了非常久没找到答案。 :《  google常常不好用。。。

okay,到眼下为止。键盘分拆,浮动,收回动作能够完美展现。可是出现了一点瑕疵,键盘收起时,会出现输入框中的字有闪烁,以挑剔的眼光来说,这是个问题:

看上面代码,在键盘出现变化时。停止全部的动画。键盘结束时继续,debug后发现就是在动画停止的时候文字消失。開始动画后出现。

推断是由于控件儿在停止编辑事件/键盘收起事件中有又一次设置文字信息。

经过查找:在CCEditBoxImplIOS.mm中发现了---

- (BOOL)textFieldShouldEndEditing:(UITextField *)sender

{

CCLOG("textFieldShouldEndEditing...");

editState_ =
NO;

getEditBoxImplIOS()->setText(getEditBoxImplIOS()->getText());

cocos2d::extension::CCEditBoxDelegate* pDelegate =
getEditBoxImplIOS()->getDelegate();

if (pDelegate != NULL)

{

pDelegate->editBoxEditingDidEnd(getEditBoxImplIOS()->getCCEditBox());

pDelegate->editBoxReturn(getEditBoxImplIOS()->getCCEditBox());

}

cocos2d::extension::CCEditBox*  pEditBox=
getEditBoxImplIOS()->getCCEditBox();

if (NULL != pEditBox && 0 != pEditBox->getScriptEditBoxHandler())

{

cocos2d::CCScriptEngineProtocol* pEngine =
cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine();

pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(),
"ended",pEditBox);

pEngine->executeEvent(pEditBox->getScriptEditBoxHandler(),
"return",pEditBox);

}

if(editBox_ !=
nil)

{

// getEditBoxImplIOS()->onEndEditing(); //就是这里,onEndEditing又一次给设置内容了,似乎内容没有不论什么的变化

}

return
YES;

}

void
CCEditBoxImplIOS::onEndEditing()

{

m_systemControl.textField.hidden =
YES;

if(strlen(getText()) == 0)

{

m_pLabel->setVisible(false);

m_pLabelPlaceHolder->setVisible(true);

}

else

{

m_pLabel->setVisible(true);

m_pLabelPlaceHolder->setVisible(false);

setInactiveText(getText());

}

}


凝视掉textFieldShouldEndEditing方法。发现画面不再闪烁。 下班以后。。

。。 汗一个。这个问题从事几乎相同2天,再次感谢google,假如还找不到信息。关于疯狂

暂时还没有发现任何问题。我们欢迎评论!

keyboard splitting bug on ipad with ios 5 and 6 (Cocos2d-x)的更多相关文章

  1. iOS手势学习UIGestureRecognizer & cocos2d 手势推荐

    iOS手势学习UIGestureRecognizer & cocos2d 手势推荐 手势识别类型: UILongPressGestureRecognizer  // 长按UIPanGestur ...

  2. [BUG]微信小程序ios时间转换

    描述 小程序ios   new Date('2019-08-14T08:00:00.000+0000')   显示为  <Date: null>. '2019-08-14T08:00:00 ...

  3. iPhone 和 iPad的ios 开发中 利用 WebViewJavascriptBridge组件,通过 UIWebView 对Html进行双向通讯

    本文转载至 http://blog.csdn.net/remote_roamer/article/details/7261490 WebViewJavascriptBridge 项目的 官网 http ...

  4. 移动端上传照片 预览+Draw on Canvas's Demo(解决 iOS 等设备照片旋转 90 度的 bug)

    背景: 本人的一个移动端H5项目,需求如下: 需求一:手机相册选取或拍摄照片后在页面上预览 需求二:然后绘制在canvas画布上 这里,我们先看一个demo(http://jsfiddle.net/q ...

  5. iOS Orientation bug

    Every September means pain for iOS developers- you need to make sure your old apps/code run on the n ...

  6. iOS 之 调试、解决BUG

    iOS 解决一个复杂bug 之 计分卡 iOS 调试 之 打印 iOS 错误之 NSObject .CGFloat iOS bug 之 H5 页面没有弹出提示框 iOS 日志工具 CocoaLumbe ...

  7. 周记3——解决fixed属性在ios软键盘弹出后失效的bug

    这周在做空间(“类似”qq空间)项目.首页是好友发表的说说,可以针对每条说说进行评论,评论框吸附固定在屏幕底部.此时,Bug来了...在ios上,软键盘弹出后fixed属性失效了.后来发现,ios绝大 ...

  8. iOS平台iPhone和iPad免费开放源代码游戏案例列表

    此页面列表收集的是一些iPhone和iPad等iOS操作系统的开放源代码(Open Source)游戏.这些iOS开源游戏都是曾经或正发布在App Store.列表中的这些iOS开源游戏都是使用主流的 ...

  9. 【Openvpn】iOS OpenVPN客户端设置指南(适用iPhone/iPad)

    适用于iPhone/iPad/这些iOS设备.之前iOS使用OpenVPN是需要越狱的,并且是付费第三方应用. 去年开始OpenVPN官方推出了iOS客户端就好用多了,免费也无需越狱. 说明:如果是新 ...

随机推荐

  1. Blend4精选案例图解教程(三):一键拖拽

    原文:Blend4精选案例图解教程(三):一键拖拽 拖拽效果,常规实现方法是定义MoveLeftDwon.MoveLeftUp.MouseMove事件,在Blend的世界里,实现对象的拖拽,可以不写一 ...

  2. BZOJ 2006 NOI2010 超级钢琴 划分树+堆

    题目大意:给定一个序列.找到k个长度在[l,r]之间的序列.使得和最大 暴力O(n^2logn),肯定过不去 看到这题的第一眼我OTZ了一下午... 后来研究了非常久别人的题解才弄明确怎么回事...蒟 ...

  3. STM32本学习笔记EXTI(外部中断)

    参考资料:STM32数据表.网络信息 =========================================切割线===================================== ...

  4. C++习题 商品销售

    Description 商店销售某一商品,每天公布统一的折扣(discount).同时允许销售人员在销售时灵活掌握售价(price),在此基础上,一次购10件以上者,还可以享受9.8折优惠.现已知当天 ...

  5. poj 3074 Sudoku(Dancing Links)

    Sudoku Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8152   Accepted: 2862 Descriptio ...

  6. Android新建项目后src下没有自动生成文件

    最近开始学Android了,按照教材新建了一个项目,发现src下没有自动生成文件,怎么回事呢? 出现这种可能的原因很可能是ADT与SDK版本不同,造成不兼容. 在ADT(或者eclipse)中的hel ...

  7. CodeForces 484A Bits

    意甲冠军: 10000询价  每次查询输入L和R(10^18)  在区间的二进制输出指示1大多数数字  1个数同样输出最小的 思路: YY一下  认为后几位全是1的时候能保证1的个数多  那么怎样构造 ...

  8. 综合第一篇文章(带钩Quora)

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxNDc4MzAyNw==/font/5a6L5L2T/fontsize/400/fill/I0JBQk ...

  9. IIS URL Rewrite Module防盗链规则配置方法

    IIS版本:IIS 7.5 URL Rewrite组件:IIS URL Rewrite Module(http://www.iis.net/downloads/microsoft/url-rewrit ...

  10. 使用autoconf和automake生成Makefile文件(转)

    Makefile好难写 曾经也总结了一篇关于Makefile的文章<make和makefile的简单学习>.但是,总结完以后,发现写Makefile真的是一件非常痛苦的事情,的确非常痛苦. ...