Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chen8002004

macrumors newbie
Original poster
May 22, 2011
26
0
I am trying to add a stretchable image as background in UIView with the following code. However, the image is shown one after another, but not stretched. Can anyone help me about it?

UIImage *theImage = [[UIImage imageNamed:mad:"BackgroundImage.png"] stretchableImageWithLeftCapWidth:0 topCapHeight:0];
[self setBackgroundColor:[UIColor colorWithPatternImage: theImage]];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.