IOS: change UIImageView with tag value

前端 未结 3 986
梦如初夏
梦如初夏 2021-02-08 12:51

I have 20 UIImageView and i want change their image; but I don\'t want to create 20 IBOutlet, and I want to use tag value to change the image; I set the tag value in interface b

3条回答
  •  别那么骄傲
    2021-02-08 13:46

    UIImageView *imageView=(UIImageView *)[self.view viewWithTag:*givetag*];
    [imageView setImage:[UIImage imageNamed:@"nameof yourimage"]];
    

提交回复
热议问题