iOS でアプリの縦表示を強制しようとしています。簡単なことのはずですが、オンラインで見つけた解決策はどれもうまくいかないようです。私のView Controllerのコードの一部は次のとおりです。
- ( void )viewWillAppear:( BOOL )animated
{
[ super viewWillAppear:animated ];
[ [ UIDevice currentDevice ] setValue:@( 1 ) forKey:@"orientation" ];
}
-(BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
return NO;
}
- (BOOL)shouldAutorotate {
return NO;
}
-(NSUInteger)supportedInterfaceOrientations {
// return UIInterfaceOrientationMaskPortrait; //tried both
return UIInterfaceOrientationPortrait;
}
これは、オンラインで見つけたいくつかのソリューション/投稿の結合であり、私のアプリはまだ「魔法のように回転します」. 私が行方不明であることは明らかですか?私はiOS 8.3用のXcode 6.3で開発しています。
ありがとう!