读取bundle中的图片
作者:
三岁就很乖 | 来源:发表于
2016-11-14 16:55 被阅读305次 // 方法1
UIImage *image = [UIImage imageNamed:@"MyTest.bundle/Test"];
// 方法2
NSString *file1 = [[NSBundle mainBundle] pathForResource:@"MyTest.bundle/Test" ofType:@"png"];
UIImage *image1 = [UIImage imageWithContentsOfFile:file1];
// 方法3
NSString *path = [[NSBundle mainBundle] pathForResource:@"MyTest" ofType:@"bundle"];
NSBundle *bundle = [NSBundle bundleWithPath:path];
NSString *file2 = [bundle pathForResource:@"Test" ofType:@"png"];
UIImage *image2 = [UIImage imageWithContentsOfFile:file2];
本文标题:读取bundle中的图片
本文链接:https://www.haomeiwen.com/subject/iwwhpttx.html
网友评论