I am developing one application.In that i set the one image as background for uiview like below
projectview=[[UIView alloc]initWithFrame:CGRectMake(200, 0, 640, 700)];
UIGraphicsBeginImageContext(projectview.frame.size);
[[UIImage imageNamed:@"board.png"] drawInRect:projectview.bounds];
UIImage *lblviewimage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
projectview.backgroundColor=[UIColor colorWithPatternImage:lblviewimage];
[self.view addSubview:projectview];
It’s working fine in simulator.But when i run this one in device,that image is added to uiview and the remaining space other than that image will be appeared as black.So please tell me how can i remove that black color.
Simply use
projectview.backgroundColor = [UIColor clearColor];Or if you want to display the default white color then write
projectview.backgroundColor = [UIColor whiteColor];Now,
Dont set the background of the UIView, add another imageView on it and set the frame accordingly.