1

我有一个DialogViewController为主 UI 加载的(登录)

        window = new UIWindow(UIScreen.MainScreen.Bounds);
        var logonView = new LogonViewController();
        window.AddSubview(logonView.View);

问题是状态栏隐藏了屏幕顶部 5 毫米左右。

我如何告诉它UIWindow是可用屏幕的大小,而不是包含状态栏的屏幕。

4

1 回答 1

0

What if you set the root view controller instead?

    window.RootViewController = logonView;

If you call AddSubview instead of setting the RootViewController you should get the warning "Applications are expected to have a root view controller at the end of application launch", and some things (such as rotation) will not work correctly.

Otherwise you could probably set logonView.Frame to account for the size of the status bar.

于 2013-05-10T19:19:49.927 回答