ipad SplitView Orientation in DetailView

Posted by nishantcm on Stack Overflow See other posts from Stack Overflow or by nishantcm
Published on 2010-05-13T10:09:45Z Indexed on 2010/05/13 10:14 UTC
Read the original article Hit count: 633

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);

    } }

© Stack Overflow or respective owner

Related posts about ipad

Related posts about uisplitviewcontroller