zoukankan      html  css  js  c++  java
  • 关于ios5 不能登录的问题

       现在 iOS7已经发布了有一段时间,想必大家都已经熟悉了ios6 、7的一些新的写法,而目前还是有一些客户是ios5 的系统的,因此可能会遇到不能正常登录和使用的问题,这次我也是遇到了 ,由于ios5只在10.8.5及之前的系统版本上支持,所以要找测试环境还是比较麻烦的。

    在应用程序中,如果使用了定义图片的函数  

    - (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets NS_AVAILABLE_IOS(5_0); // create a resizable version of this image. the interior is tiled when drawn.

    或者是

    - (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets resizingMode:(UIImageResizingMode)resizingMode NS_AVAILABLE_IOS(6_0); // the interior is resized according to the resizingMode

    就会有相应的问题出现  带有 resizingMode参数的方法 是ios6才支持的,这个当时未发现

    解决方法:

    推荐的兼容宏

    #ifndef ResizableImageWithCapInsets

    #if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000

    #define ResizableImageWithCapInsets(__outImageObject, __imageObject,__edgeInsets)

    UIImage *__outImageObject = [__imageObject resizableImageWithCapInsets:__edgeInsets];

    #else

    #define ResizableImageWithCapInsets(__outImageObject, __imageObject,__edgeInsets)

    UIImage *__outImageObject = [__imageObject resizableImageWithCapInsets:__edgeInsets resizingMode:UIImageResizingModeTile];

    #endif

    #endif

    还有就是关于 ios6需要为cell 注册 nib 或者 class 

    1. - (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(5_0);  
    2. - (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(6_0);</span>  

    之后就可以使用

    dequeueReusableCellWithIdentifier:forIndexPath:来获得一个cell实例。

  • 相关阅读:
    破解登录手机验证码思路
    自媒体平台越来越多,取舍之后我只推荐这7家平台
    微信小程序:JS 交互逻辑
    微信小程序:WXSS 样式
    微信小程序:WXML 模板
    微信小程序:页面配置 page.json
    SQLServer创建维护计划失败 错误c001f011
    远程连接提示要求的函数不受支持如何解决
    安装 SQLManagementStudio_x86_CHS(SQL Server Management Studio) 老提示重启的解决办法
    数据库属性
  • 原文地址:https://www.cnblogs.com/lixiong-iOS/p/3613979.html
Copyright © 2011-2022 走看看