When I am switching between Portrait to Landscape view (&Vice Versa) in iPad, position of my popover view gets garbled. Here is how I am calculating frame of my popover view:
aRect = self.myElement.frame;
aRect.origin.x += aRect.size.width;
[aPopOver presentPopoverFromRect:aRect inView:self.myElement.superview permittedArrowDirections:UIPopoverArrowDirectionRight animated:YES];
Please tell me whats wrong here?
ok, i notice something weird about your code.
any reason you are adding the size of the wide to the origin of aRect’s x position?
aRect.origin.x += aRect.size.width;
im assuming you want this to be the top right corner….
You can uncomment the code in your .m file and make it like so:
Or what i would do in your situation if you want to layout your subviews is use the didRotateFromIntferfaceOrientation: like so:
and also layoutSubviews
It works like so.
PK