Ok, once I have my UIImage that has been initialized as stretchable and have added it to my UIImageView that I am using, how do I go about stretching it?
What is the size of the balloon.png? If it's not at least 51 x 51 then you need to change the numbers for the stretchable image. The cap width and the cap height must be less than half the width and height of the image respectively.
Just to be sure - do you really want a stretchable image or do you just want to scale this image?
What worked for me with stretchableImageWithLeftCapWidth
Old post but I thought I'd add what I found:
This worked for me:
UIImage *labelImage=[[UIImage imageNamed:@"myRoundedRect.png"] stretchableImageWithLeftCapWidth:140 topCapHeight:30];
//My image is 280 wide and 63 high, using just less than half size seems to look best
//In previous posted code, UIImageView was not initialized, this may have been the problem
UIImageView *labelImageView = [[UIImageView alloc] init];
labelImageView.image = labelImage; //see alternative
labelImageView.frame = CGRectMake(0,0,290,360); //I wanted this big
Is your imageview's contentmode set to uiviewcontentmodescaletofill, or something else that will actually link the image's size to the size of the imageview's frame?