0
次のコードを使用すると、何も表示されません。私のiPadアプリが向きの変更を検出しないのはなぜですか?
次のコードを使用すると、何も表示されません。私のiPadアプリが向きの変更を検出しないのはなぜですか?
これが起因し得るあなたのVCはVCの階層構造の内部にネストされているような方法で
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
NSLog(@"I am starting to rotate");
}
おかげで... ...それを理解することはできません。
This SOのポストはあなたを助ける必要があります。
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
if(self.interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
self.interfaceOrientation == UIInterfaceOrientationLandscapeRight){
NSLog(@"I am starting to rotate in Landscape");
} else {
NSLog(@"I am starting to rotate in Portrait");
}
}
をし、それが
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
、このコードがあったかのようにこれを残しますか? – bandejapaisa
View Controllerをネストしていますか? –
ビューコントローラがコンテナに入っています... –