4
votes

I'm trying to write a custom keyboard for iOS8 and so far, minus the odd hiccup, I've not had too many issues. However, when I create a view and add it as a subview of a UIButton I've added to the keyboard view the newly added view is clipped at the top of the keyboard view. From what I can tell, the hierarchy is as follows:

UIView (popup) -> UIButton (actual "key") -> UIInputView

With this hierarchy, the top-level UIView is being clipped inside the UIInputView. Each UIView has had clipsToBounds set to false, and I also set the UIView (self.view) to false within the UIInputViewController, but that doesn't seem to have helped.

It could be that this is a restriction of the extension system currently, but hopefully it's something silly I'm doing!

1
The system won't allow it. "In addition, it is not possible to display key artwork above the top row, as the system keyboard does on iPhone when you tap a key in the top row."Spentak
Joseph - can you send me a link to your code? I'm trying to add subviews but the keyboard always comes up blank and does not show my UIButtons. I'd love to see an implementation that is workingSpentak
@Spentak I just found that quote in the documentation, thanks. It seem far too restrictive to be able to make and iOS-like keyboard, which is quite a shame. When you create a new keyboard extension target it provides some example code with a button to take you to the next keyboard, use that a starting point?Joseph Duffy
Possible duplicate of my issue : stackoverflow.com/questions/26293583/… If you examine the view hierarchy you can see that the UIWindow holding the keyboard extension doesn't extend above the keyboard, so even if you turn off clipsToBounds in the entire view hierarchy up to the window, you still can't display outside the window.Muzammil

1 Answers

5
votes

This is actually not possible. According to the docs it states "In addition, it is not possible to display key artwork above the top row, as the system keyboard does on iPhone when you tap a key in the top row.", which is a shame.

Thanks to @Spentak for pointing that out