あなたは、デバイスの向きの変化に耳を傾け、表示/非応じてボタンを表示する必要があります。
のviewDidLoadでは、これを追加します。
- (void)viewDidLoad {
[super viewDidLoad];
[self configureYourButtonForOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil];
}
が、あなたは現在のステータスバーの向きをやりたいです。あなたにご連絡ください。
- (void)orientationChanged:(NSNotification *)notification{
[self configureYourButtonForOrientation:[[UIApplication sharedApplication] statusBarOrientation]];
}
- (void)configureYourButtonForOrientation:(UIInterfaceOrientation)orientation{
switch (orientation) {
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
break;
case UIInterfaceOrientationPortrait:
case UIInterfaceOrientationPortraitUpsideDown:
break;
default:
break;
}
}