Skip to content

Instantly share code, notes, and snippets.

@nantekkotai
Created March 29, 2012 10:26
Show Gist options
  • Save nantekkotai/2235680 to your computer and use it in GitHub Desktop.
Save nantekkotai/2235680 to your computer and use it in GitHub Desktop.
iOSのOrientation固定の方法

viewController内の以下メソッドを修正する。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // もとのはコメント化
    //return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    // 以下の設定だとポートレート固定になる
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment