Xamarin.ios 如何强制横向模式并仅在横向模式下显示屏幕?
我已经做了下面所有的事情,但屏幕仍然自动旋转到纵向Xamarin.ios 如何强制横向模式并仅在横向模式下显示屏幕?,xamarin.ios,Xamarin.ios,我已经做了下面所有的事情,但屏幕仍然自动旋转到纵向 更正:为了说明这一点,我只需要其中一个屏幕就可以进行横向和横向。其余部分可以通过设备进行定向 public override void ViewDidAppear(bool animated) { WillAnimateRotation(UIInterfaceOrientation.LandscapeLeft, 0.0); base.ViewDidAppear(animated); }
更正:为了说明这一点,我只需要其中一个屏幕就可以进行横向和横向。其余部分可以通过设备进行定向
public override void ViewDidAppear(bool animated)
{
WillAnimateRotation(UIInterfaceOrientation.LandscapeLeft, 0.0);
base.ViewDidAppear(animated);
}
public override UIInterfaceOrientationMask GetSupportedInterfaceOrientations()
{
return UIInterfaceOrientationMask.Landscape;
}
public override UIInterfaceOrientation PreferredInterfaceOrientationForPresentation()
{
return UIInterfaceOrientation.LandscapeLeft;
}
public override bool ShouldAutorotate()
{
return false;
}
在“项目选项”对话框或info.plist编辑器中,您可以选择应用程序支持的设备方向
我只需要其中一个屏幕就可以进入横向,而只需保持横向。其余部分可以通过设备进行定向