开发者

have many images with one object

开发者 https://www.devze.com 2023-03-30 00:57 出处:网络
I have one UIImageView object. With this one object I need to set 12 frames and 12 images. with one object.

I have one UIImageView object. With this one object I need to set 12 frames and 12 images. with one object. How?

UIImageView *obj = [[UIImageView alloc]init];

[obj setFrame:CGRectMake(10,20,50,56)];

[obj setImage:[UIImage imageNamed:@"x"]];

this is one image and frame declaration with one o开发者_运维技巧bject. Like this I need to add 12 images and frames with one object.


are you trying to animate? or are you trying to show 12 images simultaneously? If you are trying to animate use GameBit's answer. If you are trying to show 12 images simultaneously you need 12 UIImageView objects. If you want to keep them all together you can add them to a single UIView. Think of it like a container for your ImageViews.


Try using this method: [UIImageView setAnimationImages:].

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号