Loading an Image from documents directory

后端 未结 6 1815
温柔的废话
温柔的废话 2020-12-03 13:51

I cant get my Image(.png) to display.

I check that it exists at the path I use, and it does. But no image appears.

Here is what I\'ve been trying:

         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-03 14:27

    Your url is perfect.

    You need to initialise image with following line

    UIImage *thumbNail=[UIImage imageWithContentsOfFile:imagePath];
    

    now do this

    [imgView setImage:thumbNail];
    
    [cell addSubview:imgView];
    

提交回复
热议问题