How to display image on UIImageView using URL and NSString in ios?

后端 未结 10 2216
孤城傲影
孤城傲影 2021-01-02 16:49

I want to display image on UIImageView using URL and NSString. I am unable to show image.

My code is:

UIImageView *view_Im         


        
10条回答
  •  余生分开走
    2021-01-02 17:04

    for showing image from url you can try this...

     [ImageViewname setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",your url]]];
    

    for showing image locally from app you can try this....

     ImageViewname.image = [UIImage imageNamed:@"test.png"];
    

    I hope this will help you.

    happy coding...

提交回复
热议问题