<legend id='zrQnf'><style id='zrQnf'><dir id='zrQnf'><q id='zrQnf'></q></dir></style></legend>

      1. <small id='zrQnf'></small><noframes id='zrQnf'>

      2. <tfoot id='zrQnf'></tfoot>

          <bdo id='zrQnf'></bdo><ul id='zrQnf'></ul>
        <i id='zrQnf'><tr id='zrQnf'><dt id='zrQnf'><q id='zrQnf'><span id='zrQnf'><b id='zrQnf'><form id='zrQnf'><ins id='zrQnf'></ins><ul id='zrQnf'></ul><sub id='zrQnf'></sub></form><legend id='zrQnf'></legend><bdo id='zrQnf'><pre id='zrQnf'><center id='zrQnf'></center></pre></bdo></b><th id='zrQnf'></th></span></q></dt></tr></i><div id='zrQnf'><tfoot id='zrQnf'></tfoot><dl id='zrQnf'><fieldset id='zrQnf'></fieldset></dl></div>
      3. [[CCDirector sharedDirector]winSize] 错误

        [[CCDirector sharedDirector]winSize] is wrong([[CCDirector sharedDirector]winSize] 错误)

          1. <i id='pnYYI'><tr id='pnYYI'><dt id='pnYYI'><q id='pnYYI'><span id='pnYYI'><b id='pnYYI'><form id='pnYYI'><ins id='pnYYI'></ins><ul id='pnYYI'></ul><sub id='pnYYI'></sub></form><legend id='pnYYI'></legend><bdo id='pnYYI'><pre id='pnYYI'><center id='pnYYI'></center></pre></bdo></b><th id='pnYYI'></th></span></q></dt></tr></i><div id='pnYYI'><tfoot id='pnYYI'></tfoot><dl id='pnYYI'><fieldset id='pnYYI'></fieldset></dl></div>

              <tfoot id='pnYYI'></tfoot>

              <small id='pnYYI'></small><noframes id='pnYYI'>

              <legend id='pnYYI'><style id='pnYYI'><dir id='pnYYI'><q id='pnYYI'></q></dir></style></legend>
                • <bdo id='pnYYI'></bdo><ul id='pnYYI'></ul>
                    <tbody id='pnYYI'></tbody>
                • 本文介绍了[[CCDirector sharedDirector]winSize] 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我从根视图控制器的 init 方法调用 cocos2d 中的 CGSize winSize = [[CCDirector sharedDirector]winSize]; 并在它报告屏幕为纵向后立即调用 nslog "winSize"实际上它在风景中.当您从 -(void)onEnter 或从根视图加载的视图中调用它时,不会发生此错误.我看到其他一些人在谷歌搜索问题后遇到了这个问题,但没有人真正知道如何解决它,或者答案不适用于我.

                  When I call CGSize winSize = [[CCDirector sharedDirector]winSize]; in cocos2d from the init method of the root view controller and nslog "winSize" right after it reports that the screen is in portrait when in fact its in landscape. This error doesn't occur when you call it from -(void)onEnter or from a view that was loaded from the root view. I see that a few other people are having this problem after googling the problem but no one really seams to know how to fix it or the answer doesn't apply to me.

                  推荐答案

                  是的,这是 cocos2D 2.0 中的严重问题之一.当我尝试第一个场景的 init 方法时.

                  Yes, This is one of the serious problem in cocos2D 2.0. When I try in init method of first scene.

                  而不是 init 尝试 onEnter.

                  Instead of init try onEnter.

                  -(void)onEnter
                  {
                    [super onEnter];
                    CGSize winSize = [[CCDirector sharedDirector]winSize];
                  
                    //Place all your init functions here.
                  }
                  

                  注意:在 iphone5 中,缺少 Default-568h@2x.png 也会导致尺寸错误!!!Cocos2d 3.0:

                  Note: In iphone5, missing Default-568h@2x.png also result wrong size!!! Cocos2d 3.0:

                  CGSize s = [[CCDirector sharedDirector] viewSize];

                  CGSize s = [[CCDirector sharedDirector] viewSize];

                  这篇关于[[CCDirector sharedDirector]winSize] 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  what#39;s property copy means in Cocoa#39;s Framework?(like UITabBar#39;s items property)(Cocoa 框架中的属性副本是什么意思?(如 UITabBar 的 items 属性))
                  Can`t copy file from bundle to documents directory in iOS(无法将文件从捆绑包复制到 iOS 中的文档目录)
                  How to copy a quot;Dictionaryquot; in Swift?(如何复制“字典在斯威夫特?)
                  Android file copy(安卓文件拷贝)
                  Automatically copy property values from one object to another of a different type but the same protocol (Objective-C)(自动将属性值从一个对象复制到另一个类型不同但协议相同的对象 (Objective-C))
                  Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                  <i id='mtxjA'><tr id='mtxjA'><dt id='mtxjA'><q id='mtxjA'><span id='mtxjA'><b id='mtxjA'><form id='mtxjA'><ins id='mtxjA'></ins><ul id='mtxjA'></ul><sub id='mtxjA'></sub></form><legend id='mtxjA'></legend><bdo id='mtxjA'><pre id='mtxjA'><center id='mtxjA'></center></pre></bdo></b><th id='mtxjA'></th></span></q></dt></tr></i><div id='mtxjA'><tfoot id='mtxjA'></tfoot><dl id='mtxjA'><fieldset id='mtxjA'></fieldset></dl></div>

                      <tbody id='mtxjA'></tbody>
                  1. <tfoot id='mtxjA'></tfoot>

                        • <small id='mtxjA'></small><noframes id='mtxjA'>

                            <bdo id='mtxjA'></bdo><ul id='mtxjA'></ul>
                          • <legend id='mtxjA'><style id='mtxjA'><dir id='mtxjA'><q id='mtxjA'></q></dir></style></legend>