Xcode 故事板布局大小模拟 - 键盘向上? [英] Xcode storyboard layout size simulation - keyboard up?

查看:39
本文介绍了Xcode 故事板布局大小模拟 - 键盘向上?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在 Interface Builder 中单击这些按钮:

改变你正在处理的视图控制器的大小,然后自动布局求解器在那里解决它.

很明显,您可以在各种尺寸的屏幕上查看布局.

当然,某处有一个函数可以让键盘出现".

如何在情节提要上显示键盘或允许键盘区域?

解决方案

Xcode 9 中没有这个功能.

但是,您可以为视图控制器提供自定义的自由格式大小以模拟键盘外观.

  1. 选择一个视图控制器并点击右侧边栏上的尺寸检查器(左起第五个图标).

  2. 视图控制器部分为大小选择自由形式.

  3. 输入您选择的尺寸.

    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.

    1. Select a view controller and click on the Size Inspector on the right sidebar (the fifth icon from the left).

    2. Select Freeform for Size in the View Controller section.

    3. Enter a size of your choice. You can calculate with a general keyboard height of 216.

    这篇关于Xcode 故事板布局大小模拟 - 键盘向上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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