Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix editbox landscape issue #1443

Merged
merged 3 commits into from Jan 17, 2017

Conversation

zilongshanren
Copy link
Contributor

Re: https://github.com/cocos-creator/fireball/issues/5091
Changes proposed in this pull request:
*

@cocos-creator/engine-admins

@@ -524,7 +525,7 @@ var View = cc._Class.extend({
*/
setFrameZoomFactor: function (zoomFactor) {
this._frameZoomFactor = zoomFactor;
this.centerWindow();
// this.centerWindow();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 这里的 centerWindow 貌似并没有实现,所以我注释掉了,你看看是否有问题。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,这个貌似是桌面 web 模拟器的需求,可以问一下 @jareguo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我不太清楚这个需求,应该没有吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jareguo 这个 centerWindow 函数貌似在 cc.view 里面没有实现,这个现在还有用到么?

@@ -66,6 +66,7 @@ switch(__BrowserGetter.adaptationType){
__BrowserGetter.__defineGetter__("target-densitydpi", function(){
return cc.view._targetDensityDPI;
});
break;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 这里貌似漏了一个 break,你看看是故意如此,还是错误。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

检查了一下 target-densitydpi 已经没有在用了,这段 case 可以删除,对适配没有影响

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 那我加一个 break 也没有影响吧? 至少 linter 不会报错。

Copy link
Contributor

@pandamicro pandamicro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在两端 focus 和 blur 都是重复代码,合并下吧

}
}, TIMER_NAME);
}

function scrollWindowUp(editBox) {
if (cc.sys.os === cc.sys.OS_IOS && cc.sys.osMainVersion === 9) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你确定只有 iOS 9 需要?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 这个是之前 ios9 有问题,所以才加的代码。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 代码已经合并

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我之前测 Android 有一些也有问题。。。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 现在发现 UC 浏览器键盘弹出来后会自动缩回去,不过这是另外一个问题了,跟这个 PR 无关。

@@ -66,6 +66,7 @@ switch(__BrowserGetter.adaptationType){
__BrowserGetter.__defineGetter__("target-densitydpi", function(){
return cc.view._targetDensityDPI;
});
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

检查了一下 target-densitydpi 已经没有在用了,这段 case 可以删除,对适配没有影响

@@ -524,7 +525,7 @@ var View = cc._Class.extend({
*/
setFrameZoomFactor: function (zoomFactor) {
this._frameZoomFactor = zoomFactor;
this.centerWindow();
// this.centerWindow();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,这个貌似是桌面 web 模拟器的需求,可以问一下 @jareguo

cc.container.style.transform = 'rotate(0deg)';
cc.view._isRotated = false;
var policy = cc.view.getResolutionPolicy();
policy.apply(cc.view, cc.view.getDesignResolutionSize());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果游戏是横屏,手机是竖屏锁屏的,现在打开输入法之后,屏幕会缩小,我们为了 Editbox 可以输入旋转 Container 然后重新适配,这样游戏画面就会很小,如果游戏中输入框部分本来就比较小的话,很容易看不清内容,这个是之前反馈过的问题,怎么看?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pandamicro 这里不会 resizeWithBrowse 呀,所以输入框不会变得很小。你可以来我这边看一下效果。

@pandamicro pandamicro merged commit b705e2e into cocos:v1.4 Jan 17, 2017
@zilongshanren zilongshanren deleted the fix-editbox-landscape-input branch January 17, 2017 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants