1

iOS 5のshouldAutorotateToInterfaceOrientationに関して、現時点で特定の問題があります。簡単に言うと、UIInterfaceOrientationMaskAllButUpsideDownを処理する必要がある画像ビューアを除いて、プロジェクト全体がPortraitのみを処理することになっています。

基本的に、私はこのコードをすべてのviewControllersに配置します:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation*)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

次に、PageViewControllerというViewControllerがあります。UIImapgePickercontrollerを呼び出すボタンがあります。そして、画像が選択されたら、ViewController(imagePicker)を閉じて、PageViewControllerに戻り、ImageViewControllerをプッシュします。

これは:

                3

PageViewController-> ImageViewController

   1 |   A  2
     V   |

助けてくれてありがとう。

ImagePickerController

4

1 に答える 1

1

答えは別の場所にあることがわかりました。私の PageViewController では、UIPageViewController. 写真を撮るときは、ページをめくって、 を使って別のページに写真を追加しますsetViewControllers:direction:animated:completionsetViewControllers:direction:animated:completionただし、完了ブロックを使用せずに呼び出した直後に ImageViewController を提示しました。presentViewController:animated:completion:そのため、完了ブロックに移動しただけで、問題なく機能しました。

ここに例:

[self.pageController setViewControllers:controllersArray direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:^(BOOL finished) {
   if (finished)
      [self presentViewController:imageController animated:NO completion:nil];
}

これが他の誰かを助けることを願っています。

于 2012-11-30T14:05:31.580 に答える