zoukankan      html  css  js  c++  java
  • 添加 分类 自动适配图片

    #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

  • 相关阅读:
    有点难度的二分
    请教神牛_字符串hash
    引水进城
    dp的斜率优化
    关于学习oi的一些事项
    永续债
    消费税
    增值税
    BSC交流
    钉钉吐槽功能点
  • 原文地址:https://www.cnblogs.com/zhibin/p/4117686.html
Copyright © 2011-2022 走看看