I have an empty ViewController
. Programatically I'm setting back ground image.
- (void)setBackGroundImg:(NSString*) name {
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:name] drawInRect:self.view.bounds];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
}
Problem:
I'm running app in simulator. Without rotation its looks like this.
But when I rotate the simulator app looks like this
Any idea how can i fix this issue.I'm working on Xcode 5
with auto layout ON. I see no way how to set constraints in empty ViewController