<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] 错误

        时间:2024-04-14

          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] 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iOS 6 - 如何在方向改变时运行自定义代码 下一篇:当我转换为视网膜显示时,瓷砖地图的位置错误

                  相关文章

                  <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>

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

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

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