Difference between UIImage and UIImageView

后端 未结 8 877
予麋鹿
予麋鹿 2021-01-31 16:24

What is the difference between UIImage and UIImageView? Can someone explain it with an example?

8条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-31 16:25

    UIImageView *myImage = [[UIImageView alloc]init];
    [myImage setImage:[UIImage imageNamed:@"1.png"]];
    

    create an instance for UIImageView as "myImage".This is helps for dispaly data.UIImage helps for hold the data of 1.png from the assets file in the xcode.

提交回复
热议问题