我在 splitview 应用程序的 DetailView.m 中使用此代码。现在方向变化仅在设备旋转时发生。启动应用程序时不会进行检测。我也收到此警告
警告:“RootViewController”可能不会响应“-adjustViewsForOrientation:”
启动应用程序时,我需要进行哪些更改才能使应用程序调整方向代码。
> - (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);
>
> } }