iphoneアプリを横向き設定にする方法をまとめておきます。
1.UIViewControllerを継承したクラスで、[shouldAutorotateToInterfaceOrientation]
で指定向きにのみ対応させる。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
// Homeボタンが右の横向きにはYes。それ以外の3方向にはNoを返す。
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
// 他の向きも対応する場合は、他も書く
}
2. plist上に設定する。
2-1. Initial interface orientation:Landscape(right home button)
2-2. Supported interface orientations:Landscape(right home button)
0 件のコメント:
コメントを投稿