iPad で画面の縦、横を固定にするメモ
iPad を傾けると、画面が縦、横にかわるのは、使いやすい場合もあるが、使いにくい場合も多くある今回は、縦に固定する方法と、横に固定する方法、回転する方法のメモを記載する。
//画面を縦に固定
-(bool)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
//画面を右に固定する場合
UIInterfaceOrientationLandscapeRight
//画面を左に固定する場合
UIInterfaceOrientationLandscapeLeft
//回転する場合は、常に true を返却すれば良い。
//画面を縦に固定
-(bool)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
return (toInterfaceOrientation == UIInterfaceOrientationPortrait);
}
//画面を右に固定する場合
UIInterfaceOrientationLandscapeRight
//画面を左に固定する場合
UIInterfaceOrientationLandscapeLeft
//回転する場合は、常に true を返却すれば良い。