1.在原有项目新建一个名称为test的storyboard类型的文件。

storyboard在ios模拟器无法显示的问题

 

storyboard在ios模拟器无法显示的问题

2.test.storyboard添加View Controller,并设置View Controller下View的背景颜色Background为深蓝色。

storyboard在ios模拟器无法显示的问题

3.设置Main Interface为test.storyboard。

storyboard在ios模拟器无法显示的问题

4.启动调试,ios模拟器下显示为黑色界面。

storyboard在ios模拟器无法显示的问题

 

同时运行有以下警告:

warning: Unsupported Configuration: Scene is unreachable due to lack of entry points and does not have an identifier for runtime access via -instantiateViewControllerWithIdentifier:.

二、问题分析

默认新建的storyboard没有设置为Is Initial View Controller(初始视图控制器),也就是说test.storyboard没有设置为Is Initial View Controller。

三、问题解决

在test.storyboard中,切换到属性检查器,找到View Controller分类下的is initial view controller并勾上它。这样,程序启动后,会加载test.storyboard下的视图。

storyboard在ios模拟器无法显示的问题

storyboard在ios模拟器无法显示的问题

相关文章:

  • 2021-12-11
  • 2021-08-11
  • 2021-10-07
  • 2022-12-23
  • 2021-08-08
  • 2021-04-21
  • 2022-12-23
猜你喜欢
  • 2021-12-24
  • 2022-12-23
  • 2021-04-07
  • 2021-07-03
  • 2022-12-23
  • 2021-10-01
相关资源
相似解决方案