Drawing UIImage at multiple locations in UIImageView
-
06-07-2019 - |
Question
I'm kind of lost in between UIImage, UIImageView, CG, layers... I want to draw the same UIImage multiple times in the same UIImageView. I don't want to have a separate subview for each of those objects. It's enough to have a flat image. How do I do that?
Solution
UIImageView does not allow you to do that. Instead, I would recommend you to use a regular UIView and use the drawRect: function to draw the images. Take a look at the Core Graphics docs if you want to know how to do that.
OTHER TIPS
i found this as i was also looking for answers to this question
You'll have to create multiple UIImage
objects to do this. Really a UIImageView
is the wrong choice. Create a UIView
and just add mulitple UIImageView
objects to it. Sorry.
Well I guess it is simple
[imageView addSubview:myTextView];
where myTextView can be made using the following piece of code
UIImage *myImage = [[uiimage alloc]initwithname:@"txtImage"];
UIImageView *myTextView =
[[UIImageView alloc]initwithframe:("enter the height width you want ")];