Loading an Image from documents directory

后端 未结 6 1811
温柔的废话
温柔的废话 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:21

    You need to give proper file url which will be

    NSURL *imgURL = [NSURL fileURLWithPath:imgPath];
    

    then initialize your image with proper imgURL var and finally to add the image to your cell you need to do the following

    [cell.contentView addSubview:imgView];
    

    I hope it may solve your problem.

提交回复
热议问题