在Swift 3中没有自动布局可以降低键盘的高度吗? [英] Is it possible to decrease the height of the keyboard without auto layout in Swift 3?

查看:127
本文介绍了在Swift 3中没有自动布局可以降低键盘的高度吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要以编程方式降低键盘的高度。有什么办法可以吗?我发现我们可以使用键盘扩展来降低高度,但我尝试了它并不适合我。

I need to decrease the height of the keyboard programatically. Is there any way I can do it? I have found that we can reduce height, using keyboard extensions but I tried and it doesn't work for me.

我有什么方法可以做到这一点吗?

Is there any way I can do this?

编辑:但我可以在某些应用中看到小键盘。他们如何实现它。

提前致谢。

But i can see small keyboards in some of the apps . How do they acheive it. Thanks in advance.

推荐答案

无法修改框架或键盘的外观,因为它有点像应用程序上的叠加层,并且它不是应用程序所在窗口中的直接子视图。

You cannot modify the frame or the look of the keyboard, since it works kind of like an overlay over your app and it's not a direct subview in the window where your app lives.

您可以为此方法创建自定义键盘,但请记住遵循 iOS人机界面指南

You can create a custom keyboard for this approach, but remember to follow the iOS Human Interface Guidelines.

您还可以创建一个提供输入的自定义视图(例如一堆 UIButton 如果按下它们,会在 UITextView 附加一个字母。

You can also create a custom view that provides input (for e.g. a bunch UIButtons that append a letter to a UITextView if you press them).

这篇关于在Swift 3中没有自动布局可以降低键盘的高度吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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