首页 > 其他 > 详细

添加 分类 自动适配图片

时间:2014-11-24 00:45:01      阅读:317      评论:0      收藏:0      [点我收藏+]

#import <UIKit/UIKit.h>

 

@interface UIImage (ZB)

+(UIImage *)imageWithName:(NSString *)name;

@end

 

 

 

 

#import "UIImage+ZB.h"

 

@implementation UIImage (ZB)

+(UIImage *)imageWithName:(NSString *)name{

 

    if (IOS7) {

        NSString *url=[NSString stringWithFormat:@"%@_os7",name];

    

       UIImage *image= [UIImage imageNamed:url];

        if (image==nil) {

            return [UIImage imageNamed:name];

        }else{

            return image; 

        }

        

        

    }else{

    

       return [UIImage imageNamed:name];

    }

 

}

 

@end

 

添加 分类 自动适配图片

原文:http://www.cnblogs.com/zhibin/p/4117686.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!