ipad SplitView Orientation in DetailView
- by nishantcm
I am using this code in the DetailView.m of a splitview app. Now the orientation changes occur only when the device is rotated. The detection does not take place when the app is launched. I also get this warning
warning: 'RootViewController' may not respond to '-adjustViewsForOrientation:'
What change do I need to make the app adjust the orientation code when the app is launched.
(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
duration:(NSTimeInterval)duration {
[self adjustViewsForOrientation:toInterfaceOrientation];
}
(void) adjustViewsForOrientation:(UIInterfaceOrientation)orientation
{
if (orientation == UIInterfaceOrientationLandscapeLeft ||
orientation ==
UIInterfaceOrientationLandscapeRight)
{
detailDescriptionLabel.center = CGPointMake(235.0f, 42.0f);
bigthumbImageView.center = CGPointMake(355.0f, 70.0f);
}
else if (orientation == UIInterfaceOrientationPortrait ||
orientation ==
UIInterfaceOrientationPortraitUpsideDown)
{
detailDescriptionLabel.center = CGPointMake(160.0f, 52.0f);
bigthumbImageView.center = CGPointMake(275.0f, 80.0f);
} }