How to display images of type .jpeg or .gif or .tiff in iphone sdk

前端 未结 1 1961
长发绾君心
长发绾君心 2021-01-03 04:28

I am facing a problem while displaying the image in iphone. I used the below code but it work only for .png files.

      UIImageView* imageView=[[UIImageView         


        
相关标签:
1条回答
  • 2021-01-03 05:03

    Try using this:

    imageView.image = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"imagename" ofType:@"png"]];
    

    And then replace imagename and png with your file name and type.

    0 讨论(0)
提交回复
热议问题