I am creating an app for iPad landscape mode. I have created a UIView for entire screen. But it is not displaying entire screen as width of 1024. It shows for the width of 768(means 0 to 768).
backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
[backgroundView setBackgroundColor:[[UIColor greenColor]colorWithAlphaComponent:0.5]];
backgroundView.opaque = NO;
backgroundView.userInteractionEnabled = YES;
backgroundView.clearsContextBeforeDrawing=YES;
[self.view addSubview:backgroundView];
CGFloat x = self.view.frame.size.width;
NSLog(@"size%f",x); // 768
It happens when i run in iPad 2 (7.1) simulator
Please advice.