博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pathForResource:imgPath
阅读量:2400 次
发布时间:2019-05-10

本文共 405 字,大约阅读时间需要 1 分钟。

+(id)createImageView:(CGRect)frame forPath:(NSString *)imgPath{

    

    UIImageView *imageView = [[[UIImageView alloc] init] autorelease];

    

    imageView.frame = frame;

    

    if (imgPath != nil) {

//        UIImage *img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:imgPath ofType:@"png"]];

        UIImage *img = [UIImage imageNamed:imgPath]; //CYY 发现上边那种方法只能读取到单倍图

        imageView.image = img;

    }

    

    return imageView;

    

}

转载地址:http://bokob.baihongyu.com/

你可能感兴趣的文章
3.2.6: jQuery的DOM操作之替换节点
查看>>
3.2.7: jQuery的DOM操作之包裹节点
查看>>
3.2.8: jQuery的DOM操作之属性操作
查看>>
3.2.9: jQuery的DOM操作之样式操作
查看>>
3.2.10: jQuery的DOM操作之设置和获取HTML、文本和值
查看>>
3.2.11: jQuery的DOM操作之遍历节点
查看>>
mysql问题汇总
查看>>
日常开发中遇到的问题汇总
查看>>
js 数组操作
查看>>
LODOP
查看>>
axis2耗时问题,定时任务注入问题
查看>>
spring定时任务日常问题汇总
查看>>
微信登陆笔记
查看>>
微信支付笔记
查看>>
一寸照片制作笔记
查看>>
git使用笔记
查看>>
left join精要
查看>>
SpringMVC开发总结(更新中)
查看>>
SpringBoot环境下配置AOP切面实现权限拦截
查看>>
Spring data JPA日常开发问题
查看>>