ios开发 - 新闻资讯 - 云南小程序开发|云南软件开发|云南网站建设-昆明葵宇信息科技有限公司

159-8711-8523

云南网建设/小程序开发/软件开发

知识

不管是网站,软件还是小程序,都要直接或间接能为您产生价值,我们在追求其视觉表现的同时,更侧重于功能的便捷,营销的便利,运营的高效,让网站成为营销工具,让软件能切实提升企业内部管理水平和效率。优秀的程序为后期升级提供便捷的支持!

您当前位置>首页 » 新闻资讯 » 技术分享 >

ios开发

发表时间:2020-10-19

发布人:葵宇科技

浏览次数:31


良久没弄cocos2d-x了。今天闲着蛋疼从新玩了下。
简单说下本身解决iphone5适配的问题,办法很笨,然则挺简单的。
1.在ios目次下的RootViewController.mm文件中参加如下代码
[cpp] view plaincopy
  1. // Override to allow orientations other than the default portrait orientation.  
  2. // This method is deprecated on ios6  
  3. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {  
  4.     return UIInterfaceOrientationIsLandscape( interfaceOrientation );  
  5. }  
  6.   
  7. // For ios6, use supportedInterfaceOrientations & shouldAutorotate instead  
  8. - (NSUInteger) supportedInterfaceOrientations{  
  9. #ifdef __IPHONE_6_0  
  10.     return UIInterfaceOrientationMaskLandscape;  
  11. #endif  
  12. }  

2.手动导入Default-568h@2x.png图片。 因为有的时刻xcode不会帮我们主动导入,如不雅没有导入,高低照样黑边的。
3.在须要设置宏的处所,应用
    CCSize size = CCDirector::sharedDirector()->getWinSize();
    if (size.height == 1136)
    {
...
    }
如许的办法进行定义。
办法固然笨,那能解决问题的就是办法...

相关案例查看更多