I have an imageview in which I want an image to be set. My desi开发者_运维知识库gner have given me an image which is of the same height of imageview but the width is 1/10th of the imageview. He asked me to repeat it inside the imageview like a texture.
Is it possible to add multiple images to an imageview? I know I can do it by using 10 imageviews for each reptition. Is there anyother way like the texture thing?
Important Edit:
While the answer below is correct, I answered this too literally and didn't suggest the appropriate alternative.
A UIImageView
can only have one image, but you can fill a UIView
with a repeating pattern by using UIColor
's colorWithPatternImage
method:
// myView is the UIView to fill
// myImage is the UIImage to use as a fill pattern
myView.backgroundColor = [UIColor colorWithPatternImage:myImage];
Old Answer
No, only one UIImage per UIImageView. Your designer should repeat it himself and give you an image of the appropriate size. The iPhone is not the web, requirements are different.
精彩评论