I'm trying to stretch an image in a UIImageView, but I fail :)
The following setting:
NIB file with the view and UIImageView attached to this view.
Wire to my class using IBOutlet UIImageView *background .
Now in my class I will try the following:
UIImage *bgImage = [[UIImage imageNamed:@"myImage.png"] stretchableImageWithLeftCapWidth:0 topCapHeight:50]; [background setImage: bgImage]; bgFrame = CGRectMake(0, 0, 250, 200); background.frame = bgFrame;
which should stretch the image vertically - at least what I thought. Alas, it does not work ... :(
The image I'm using is 115 pixels high (should this be enough for stretching, I think?)
iphone stretch uiimageview
Urs
source share