On iPad following is offscreen when in portrait, why this even when starting up in portrait?
- (void)viewDidLoad
{
[super viewDidLoad];
UIView* imageView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
blue.backgroundColor = [UIColor blueColor];
[[self view] addSubview:imageView];
I have been told that the root view’s frame is always the same in portrait and landscape:
– portrait frame orign(x i representing the orign of an UIView)
x0
00
00
Landscape frame orign:
000
x00
But why is CGRectMake(0,0 .. not up in the right corner in portrait?
Thanks in advance
The bounds and the frame can change when you rotate the device. Let’s take a Single View Application template as an example, add orientation support and run it on the iPhone. In portrait:
In landscape:
Origin is always top-left corner, regardless of orientation.