iPhone 5 の解像度でアプリをテストしたいので、シミュレーターを使用しています。私のアプリには、サポートされているデバイスの向きに縦向きと 2 つの横向きがあり、回転を許可する viewControllers はshouldAutorotateToInterfaceOrientation
YES に設定されています。しかし、シミュレーターでデバイスを回転させても、デバイスのように回転しません。現在、私は標準の iPhone 4 シミュレーターを使用しています。
編集:これは、VC を設定するためのコードです。
UIViewController *vc = [[UIViewController alloc] init];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:vc];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[self.window makeKeyAndVisible];
[self.window addSubview:self.navigationController.view];
self.loadingWood = [[UIImageView alloc] init];
[vc.view addSubview:self.loadingWood];
そしてその直後:
self.timeline = [[JTimelineViewController alloc] init];
[self.navigationController setViewControllers:[NSArray arrayWithObject:self.timeline]];
これは、アプリの起動時のビジュアルに必要です。
編集2:
私は今これを機能させています。私が今直面している問題は、viewControllers の 1 つがこれを述べているにもかかわらず、iPhone シミュレーターで回転すると回転することです。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
編集 3: 私の電話は iOS5 を実行しています。シミュレーターは iOS6 を実行しています。これが考えられる理由です。サポートされている方向として Landscape Left と Landscape Right を削除すると、シミュレーターの回転はまったくなくなりますが、私の iOS5 iPhone 4 は通常どおり回転し続けます。