macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

shouldAutorotateToInterfaceOrientation:

画面が自動的に回転しようとするときに呼び出されるデリゲートメソッド。
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

解説

画面が自動的に回転しようとするときに呼び出されるデリゲートメソッド。
YESを返すと自動回転を許可、NOを返すと自動回転を許可しない。

簡単なビューのサイズ調整
contentModeをUIViewContentModeScaleAspectFill
clipsToBoundsをYESにする。

ビューの配置調整は
willAnimateRotationToInterfaceOrientation:durationで再配置する。


返り値

( BOOL )

YESを返すと自動回転を許可、NOを返すと自動回転を許可しない。

引数

( UIInterfaceOrientation )interfaceOrientation

UIInterfaceOrientation
アプリケーションのインターフェースの向き

UIInterfaceOrientationPortrait 縦向き
UIInterfaceOrientationPortraitUpsideDown 縦向き、上下逆
UIInterfaceOrientationLandscapeLeft 横向き、左
UIInterfaceOrientationLandscapeRight 横向き、右

クラス

UIViewController

Instance Methods

使用可能

iPhone2.0

参照

例文