We Can load the Xib at run time which make easy the work of resetting the frame for Portrait and landscape. Because We can create two Xib , One for portrait and second for landscape and then load at run time.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
[[NSBundle mainBundle] loadNibNamed:@"IpadChangeXibAtRunTimeViewController" owner:self options:nil];
}
else
{
[[NSBundle mainBundle] loadNibNamed:@"IpadChangeXibAtRunTimeL" owner:self options:nil]; } return YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if(interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
[[NSBundle mainBundle] loadNibNamed:@"IpadChangeXibAtRunTimeViewController" owner:self options:nil];
}
else
{
[[NSBundle mainBundle] loadNibNamed:@"IpadChangeXibAtRunTimeL" owner:self options:nil]; } return YES;
}
No comments:
Post a Comment