Thursday, September 29, 2011

Add Background Image (UIImage) To UIView


//To add a image as background for an UIView (Make sure the image is in your app’s resource bundle)
         
      - (void)viewDidLoad
      {
          self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"bgImage.png"]];
      }

1 comment:

  1. i want to fill my background image with full frame,
    if i use this code, it gives tile effect on my background

    ReplyDelete

Kamleshwar