try this ..... let say you have a button in bottom corner of your ipad . then how to put this at same location in both landscape and portrait mode ...
-(NSUInteger)supportedInterfaceOrientations
{
if ([[UIApplication sharedApplication] statusBarOrientation]==UIInterfaceOrientationMaskPortrait||[[UIApplication sharedApplication] statusBarOrientation]==UIInterfaceOrientationMaskPortraitUpsideDown) {
pButton.frame=CGRectMake(self.view.frame.size.width-70, self.view.frame.size.height-70, 70, 70);
}
else
{
pButton.frame=CGRectMake(self.view.frame.size.width-70, self.view.frame.size.height-70, 70, 70);
}
return (UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight|UIInterfaceOrientationMaskPortraitUpsideDown);
}
-(BOOL)shouldAutorotate
{
return YES;
}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
if ([[UIApplication sharedApplication] statusBarOrientation]==UIInterfaceOrientationMaskPortrait||[[UIApplication sharedApplication] statusBarOrientation]==UIInterfaceOrientationMaskPortraitUpsideDown) {
pButton.frame=CGRectMake(self.view.frame.size.width-70, self.view.frame.size.height-70, 70, 70);
}
else
{
pButton.frame=CGRectMake(self.view.frame.size.width-70, self.view.frame.size.height-70, 70, 70);
}
return YES;
}
see you have to override these methods to adjust your gui in both modes , and you have to adjust frame of your GUI elements in these methods . . .