“推断的"和“推断的"之间有什么区别?和“自由格式"在Xcode故事板中? [英] What is the difference between "Inferred" and "Freeform" in Xcode Storyboard?

查看:46
本文介绍了“推断的"和“推断的"之间有什么区别?和“自由格式"在Xcode故事板中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个自定义视图,该视图需要在所有iPhone设备(4、4S,5、5S,6和6 Plus)上显示.创建自定义视图XIB时,我已将其称为推断的",但并未为iPhone 6和iPhone 6 Plus设备调整大小.我无法弄清楚这个问题.我对推断"和自由格式"之间的实际区别感到困惑.有人可以解释这些差异吗?

解决方案

推断"是情节提要的默认设置,这意味着场景在导航控制器内部时将显示导航栏,而在导航控制器内部时将显示选项卡栏标签栏控制器,等等.如果需要,您可以覆盖这些设置,但是请记住,这些设置仅在帮助您设计屏幕时使用.在运行期间不会使用模拟指标",它们只是一种视觉设计辅助工具,可以显示屏幕最终的外观.

"FreeForm"通常,当您以编程方式将视图控制器作为子级添加到另一个视图控制器时,并确实希望具有该固定大小时,将使用freeform属性.如果按下视图控制器或将其呈现为模态视图控制器(并且您使用模式表示样式),则无需使用freeform.另外,freeform属性的另一用途是预览使用现有表示样式作为模式视图控制器表示的视图控制器的实际大小.

I have a custom view which needs to be displayed on all the iPhone devices(4, 4S, 5, 5S, 6 and 6 Plus). When creating the custom view XIB, I have mentioned it as "Inferred" but it is not resizing for iPhone 6 and iPhone 6 Plus devices. I am not able to figure out the issue. I am confused on what would be actual differences between "Inferred" and "Freeform". Can someone please explain the differences?

解决方案

"Inferred" is the default setting for storyboards and it means the scene will show a navigation bar when it’s inside of a navigation controller, a tab bar when it’s inside of a tab bar controller, and so on. You could override these settings if you wanted to, but keep in mind they are here only to help you design your screens. The Simulated Metrics aren’t used during runtime, they’re just a visual design aid that shows what your screen will end up looking like.

"FreeForm" Usually you use the freeform property when you add the view controller as a child to another view controller programmatically and you really want to have that fixed size.If you push the view controller or you present it as modal view controller (and you use the modal presentation styles) then there is no need to use freeform.Also another use of the freeform property is to preview the actual size of your view controller when is presented as a modal view controller using existent presentation styles.

这篇关于“推断的"和“推断的"之间有什么区别?和“自由格式"在Xcode故事板中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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