简体   繁体   English

自定义键盘UITextField inputView xcode

[英]custom keyboard UITextField inputView xcode

I am adding a custom keyboard to a view using inputView linked to a UITextField. 我正在使用链接到UITextField的inputView向视图添加自定义键盘。 I have set the size at Width 216, Height 320. I have it entering from the bottom on a portrait orientation. 我将尺寸设置为“宽度216”,“高度320”。我将其纵向从底部输入。 I want it to only cover 216 pixels of the screen but now when it comes up with the keyboard hugging the left side and has the correct aspect ratio. 我希望它仅覆盖屏幕的216个像素,但是现在当它出现时,键盘紧紧抓住左侧,并具有正确的宽高比。 However there is a gray background that extends from the right edge of the keyboard to the right side of the view. 但是,灰色背景从键盘的右边缘延伸到视图的右侧。 Is there any way to remove this so it is clear and I can see the right side of the view? 有什么办法可以删除它,使它清晰可见,我可以看到视图的右侧吗? I have tried setting the background of the view to clear color and tried everything I can think of. 我尝试将视图的背景设置为清除颜色,并尝试了所有我能想到的方法。 Does anyone know if this is possible? 有人知道这是否可能吗?

我猜你做不到,因为打开键盘后视图会向上移动,因此216x320点中有一个“空”矩形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM