ios7下出现的问题及解决

装了xcode5,体验了一把ios7,整个界面也是冲着扁平化的方向,怎么说呢,简约而不简单。另外ios7模拟器不是一个iphone而是一个页面,因为是高分辨率屏幕,所以大了。可以用command+1,command+2,command+3来调屏幕大小。
总之就是更好用了。

将以前写的一些app放Xcode5下编译,不少问题出来了。


首先就是界面上的状态栏了,iOS7貌似默认程序就是全屏(fullscreen)模式,用半透明的方法将状态栏挡在后面,感觉有点怪怪的,比如:

在iOS7之前,我们可以这样干:[[UIApplication sharedApplication] setStatusBarHidden:YES];

但是现在无效了,需要在app的plist文件中,添加两个属性:UIStatusBarHidden和UIViewControllerBasedStatusBarAppearance,顾名思义,就是用来设置状态栏的,如图所示:

好像用一个属性就有效果了。


20140610隐藏状态栏的改正:在plist中添加Status bar is initially hidden和View controller-based status bar appearance;第一个设置为YES,第二个设置为NO


第二个出现的问题就是CCLabel有些内容无法显示,

这个需要通过改源码,

修改CCImage.mm的

static bool _initWithString(constchar * pText, cocos2d::CCImage::ETextAlign eAlign,const char * pFontName,intnSize, tImageInfo* pInfo)



        const int _width  = dim.width;  //Add
        const int _height = dim.height;  //Add
        
        unsigned char* data = new unsigned char[(int)(dim.width * dim.height * 4)];
        memset(data, 0, (int)(_width * _height * 4));   //Modify
        
        // draw text
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();    
        CGContextRef context = CGBitmapContextCreate(data, _width, _height, 8, _width * 4, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big);
        CGColorSpaceRelease(colorSpace);                //Modify
        
        if (! context)
        {
            delete[] data;
            break;
        }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值