/ Published in: Other
Expand |
Embed | Plain Text
//!< 画面回転を許可する - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } //!< 画面回転時に呼び出される -(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { if(interfaceOrientation == UIInterfaceOrientationPortrait){ NSLog(@"縦(ホームボタン下)"); } else if(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown){ NSLog(@"縦(ホームボタン上)"); } else if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft){ NSLog(@"縦(ホームボタン右)"); } else if(interfaceOrientation == UIInterfaceOrientationLandscapeRight){ NSLog(@"縦(ホームボタン左)"); } } //--------------------------------------------------- //現在の回転方向 int direction = self.interfaceOrientation; //0 : 不明 //1 : 縦(ホームボタン下) //2 : 縦(ホームボタン上) //3 : 横(ホームボタン右) //4 : 横(ホームボタン左)
You need to login to post a comment.
