1つのView Controllerのみをポートレートでロックし、他のすべてのビューは任意の向きにするようにしています。これは私が私のhomeViewController(私は肖像画で保持したいもの)に入れようとしているものです。ポートレートのxamarinで1つのView Controllerをロックできません。
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
{
return UIInterfaceOrientationMask.Portrait;
}
public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
{
return UIInterfaceOrientation.Portrait;
}
public override bool ShouldAutorotate()
{
return false;
}
私はC#のxamarinでこれを実行しようとしています。誰か提案がありますか?
あなたのコードは、 'UIViewController'の' PresentViewController'を別の 'UIViewController'としていますが、' UINavigationController'を使用していますか?そして/またはあなたの 'homeViewController'は、アプリの起動(?)に表示される最初のVCで、ポートレートでなければならず、その後は向きがロックされているすべてのVCが必要ですか? – SushiHangover
はい私はUINavigationControllerを使用しています。 homeViewControllerが最初に読み込まれたものです。私はちょうどその肖像画でロックされたビューと残りの任意の方向にしたい。 –