简体   繁体   English

自定义UIViewController子类仅显示黑屏

[英]Custom UIViewController subclass only shows a black screen

I have created a subclass of UIViewController called LoginController. 我创建了UIViewController的子类,名为LoginController。 I have a LoginController.xib file that contains a view controller with a few elements in it. 我有一个LoginController.xib文件,其中包含带有一些元素的视图控制器。 I have set the class of the view controller to LoginController and I have set my Main Interface to LoginController. 我已经将视图控制器的类设置为LoginController,并将主接口设置为LoginController。 Upon launching my app, I see my splash screen, followed by a pure black screen. 启动我的应用程序后,我会看到我的启动屏幕,然后是纯黑屏幕。 My LoginController class just has the default code like so 我的LoginController类仅具有默认代码,如下所示

class LoginController: UIViewController
{
    override func viewDidLoad()
    {
        super.viewDidLoad()

    }

    override func didReceiveMemoryWarning()
    {
        super.didReceiveMemoryWarning()
    }
}

I just created a new xcode project. 我刚刚创建了一个新的xcode项目。 My results are totally normal. 我的结果完全正常。 So I guess it's because you are not setting the LoginController.xib as the initial xib to load? 所以我想这是因为您没有将LoginController.xib设置为要加载的初始xib吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM