I have an image pattern which I want to display in a UIImageView. The UIImageVIew\'s size is determined by user-entered text, so its height will change. Is there a way to \"casc
You should be able to accomplish this with a plain UIView
. Create a UIColor from the image (this makes a "pattern image", which can be tiled:
UIColor *patternColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"pattern"]];
Then set the background color of the view like so:
view.backgroundColor = patternColor;
I'd run this code in the viewDidLoad
or viewWillAppear
methods of the view's controller.