问题描述
您可以在 Interface Builder 中单击这些按钮:
改变你正在处理的视图控制器的大小,然后自动布局求解器在那里解决它.
很明显,您可以在各种尺寸的屏幕上查看布局.
当然,某处有一个函数可以让键盘出现".
如何在情节提要上显示键盘或允许键盘区域?
Xcode 9 中没有这个功能.
但是,您可以为视图控制器提供自定义的自由格式大小以模拟键盘外观.
选择一个视图控制器并点击右侧边栏上的尺寸检查器(左起第五个图标).
在视图控制器部分为大小选择自由形式.
输入您选择的尺寸.
You can click on these buttons in Interface Builder:
to change the size of the view controller you are working on, and the autolayout solver solves it there and then.
So obviously you can check the layout on various size screens.
Surely, there's a function somewhere that makes the "keyboard appear".
How can I show the keyboard, or allow for the keyboard area, on a Storyboard?
解决方案There is no such function in Xcode 9.
However, you can provide a custom freeform size for your view controllers to simulate a keyboard appearance.
Select a view controller and click on the Size Inspector on the right sidebar (the fifth icon from the left).
Select Freeform for Size in the View Controller section.
Enter a size of your choice. You can calculate with a general keyboard height of 216.
这篇关于Xcode 故事板布局大小模拟 - 键盘向上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!