iOS 8启动图像文件 - 导航栏和状态栏 [英] iOS 8 Launch Image File - Navigation Bar and the Status Bar

查看:90
本文介绍了iOS 8启动图像文件 - 导航栏和状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Interface Builder来创建iOS 8的启动映像文件。我想要的启动映像非常简单(与设置应用程序相同) - 导航栏顶部有一个空的分组TableView 。没有标题等。



注意,我通常不使用Interface Builder - 所以IB的东西对我来说是全新的。



我试图通过向视图添加导航栏和表视图来实现这一点,然后设置约束。约束(和颜色)运行正常,但...



问题:启动图像全屏显示, 。像这样:



如何获取状态栏和导航栏?



像我说的,当您选择在Xcode中添加启动屏幕时,将获得默认的UIView。所以没有导航控制器;是这个问题吗?



此外,在UIView有一些选项似乎他们应该给我想要的:



>



我试过使用状态栏选项,但它不是工作。




  • 我需要推断还是默认?

  • 我看到启动图像(状态栏+导航栏)和实际应用运行之间有一点偏差,


  • 我想要的图像,我甚至需要添加一个TableView作为一个子视图,或者我可以使用主要UIView的背景颜色?我试过,但后来我得到一个不匹配的颜色与状态栏/导航栏...



noob,如何创建一个复制了设置应用程序的启动屏幕文件?

解决方案

如果您使用故事板文件,您可以将视图设置为导航控制器场景中的根视图。导航控制器的导航栏会自动将其位置置于状态栏下方。





不要忘记将Navigation Controller设置为初始视图控制器(通过选中 Is Initial View Controller 属性窗格)



导航控制器场景在您将其添加到故事板时自动添加一个表视图控制器作为嵌套控制器。



如果你想用另一个控制器替换它,你必须从故事板中删除表视图控制器,添加你想要使用的控制器到故事板,然后挂接它(通过命令+拖动从导航控制器到视图控制器,然后选择rootViewController插座)



注意启动屏幕故事板中的对象(视图控制器等)有任何IBOutlets设置。这将导致错误。


I'm using Interface Builder to make the launch image file for iOS 8. The launch image that I want is very simple (same as the Settings app, I think) - Navigation Bar at the top with an empty, Grouped TableView. No title, etc.

Note, I don't normally use Interface Builder - so the IB thing is completely new to me.

I'm trying to achieve this by adding a Navigation Bar and Table View to the View - and then setting up the constraints. The constraints (and colours) are working fine, but...

The problem: the launch image displays full screen, over the status bar. Like this:

How do I get both the status bar and the navigation bar?

Like I said, I'm working with the default 'UIView' you get when you select to add a Launch Screen in Xcode. So there isn't a Navigation Controller; is that the problem?

Additionally, there are some options on the UIView that seem like they should give me what I want:

I've tried playing around with the Status Bar options, but it's not quite working.

  • Do I need Inferred or Default?
  • I'm seeing a small offset between the launch image (status bar + navigation bar) and the actual app running, have I just positioned it incorrectly?
  • What's the purpose of the Top Bar option?
  • For the launch image that I want, do I even need to add a TableView as a subview, or can I use the background colour on the main UIView? I've tried that but then I get a mismatch of colours with the status bar / navigation bar...

For an Interface Builder noob, how do I create a launch screen file that replicates that of the Settings app?

解决方案

If you are using a storyboard file, you could set your view as the root view in a Navigation Controller Scene. A Navigation Controller's navigation bar automatically positions itself below the status bar.

Don't forget to set the Navigation Controller as the initial view controller (by checking Is Initial View Controller in the property pane)

A Navigation Controller Scene automatically adds a table view controller as it's nested controller when you add it to the storyboard.

If you want to replace it with another controller, you'll have to remove the table view controller from the storyboard, add the controller you want to use to the storyboard and then hook it up (by command+dragging from the navigation controller to the view controller and then selecting the rootViewController outlet)

NOTE Objects (viewcontrollers etc.) in a launch screen storyboard should not have have any IBOutlets set. This will lead to errors.

这篇关于iOS 8启动图像文件 - 导航栏和状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆