Display local image in UIImageView

后端 未结 4 1749
[愿得一人]
[愿得一人] 2021-01-01 12:09

How do I display an image in the UIImageView component from the hard drive?

I have a local folder called \"images\" and would like to access it via a relative path,

4条回答
  •  我在风中等你
    2021-01-01 12:48

    UIImage *img = [UIImage imageWithContentsOfFile:(the file path)];
    UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
    

    check the docs for imageWithContentsOfFile:

提交回复
热议问题