iOS从沙盒中获取图片显示到view上

        NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:@"image.png"];

        UIImage *savedImage = [[UIImage alloc] initWithContentsOfFile:fullPath];

        if (savedImage != nil) {

            [_headerButton setBackgroundImage:savedImage forState:(UIControlStateNormal)];

        }


你可能感兴趣的:(ios开发)