私はすべての向きをサポートする iPhone アプリを持っていますが、1 つの UIViewController では縦向き (または逆さま) のみをサポートしたいと考えています。
次のコードを UIViewController に追加しましたが、それでも回転します。
public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation)
{
// Return true for supported orientations
return ((toInterfaceOrientation != UIInterfaceOrientation.LandscapeLeft) && (toInterfaceOrientation != UIInterfaceOrientation.LandscapeRight));
}
ShouldAutorotateToInterfaceOrientation コードをどこに追加しても、回転します!
アプリが 1 つを除くすべての UIViewControllers のすべての向きをサポートできるようにする方法はありますか?
また、私は NavigationController を使用しています - それは物事に影響しますか?