如何在iOS的Cocoapod库中使用图像Assets目录?
使用规范
在组件中怎么加载图片?
- (UIImage *)ev_imageNamed:(NSString *)imageName {
NSBundle *bundle = [NSBundle bundleForClass:[self class]];
UIImage *image = [UIImage imageNamed:imageName inBundle:bundle compatibleWithTraitCollection:nil];
return image;
}
self.ivGetStore = [[UIImageView alloc] initWithImage:[self ev_imageNamed:@"icon_hykzf"]];
网友评论