gpt4 book ai didi

c# - iPad View 不旋转

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:47:02 25 4
gpt4 key购买 nike

到目前为止,我有一个非常简单的应用程序,它不会旋转 View 。 ShouldAutorotateToInterfaceOrientation 在应用程序启动时被调用,但在我旋转时再也不会调用。我的代码如下:

public class NotebookSelectionController : UIViewController {

public override bool ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) {
return true;
}
}

我的应用委托(delegate)代码如下:

public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
var notebookController = new NotebookSelectionController();
window.AddSubview(notebookController.View);

window.MakeKeyAndVisible();

return true;
}

我错过了什么??

最佳答案

它在模拟器中工作吗?例如,当您在模拟器中打开菜单硬件/向左旋转时?如果它在那里工作 - 检查设备上你没有通过 iOS 关闭自动旋转 - 使用开关或在“多任务”栏中。

愚蠢的错误,发生在我身上很多次:)

除此之外,没有理由不能正常工作,这是正确调用的。

关于c# - iPad View 不旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5176897/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com