您的位置:首页 > 其它

读取bundel里的图片

2016-01-22 15:51 375 查看
//假设图片是存放在projectStatic.bundle的文件里:名叫blue_back@2x.png
NSString *bundlePath = [[NSBundle
mainBundle] pathForResource:@"projectStatic"
ofType:@"bundle"];
    NSString *imageName =
@"blue_back@2x.png";
    imageName = [bundlePath stringByAppendingPathComponent:imageName];
    
    [btn setBackgroundImage:[UIImage
imageNamed:imageName] forState:UIControlStateNormal];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: