Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create keyboard like buttons with UIInputView?

Tags:

ios

keyboard

With iOS 7 Apple introduced UIInputView, which allows you to add a custom view above the keyboard that looks like this (you can adjust the height):

UIInputView as the accessory input view

The docs state that:

The UIInputView class is designed to match the appearance of the standard system keyboard when used as an input view with a responder. When defining your own custom input views or input accessory views, you can use a UIInputView object as the root view and add any subviews you want to create your input view. The input view and its subviews receive tinting and blur effects based on the options you specify at initialization time.

What I do not understand, however, is how I can add additional row of buttons that look like standard keys above the keyboard (such as here in Fantastical):

Fantastical with custom keyboard keys

Is it possible to a) correctly style system UIButtons so that they appear like keys or b) is there a library that simplifies the rendering of custom keys?

like image 947
Thomas Denney Avatar asked Mar 23 '14 10:03

Thomas Denney


People also ask

Can I make my own keyboard on Iphone?

With iOS 8, Apple has made it possible to create custom keyboards that will be able to be used system wide in other apps. You can now ship a custom keyboard with your app and users will be able to choose it as the keyboard to use for every app that requires text input.


1 Answers

Here is a project of an iOS keyboard that mimics the system keyboard: https://github.com/acoomans/ACKeyboard

You could reuse the ACKey as keys for your keyboard!

like image 175
acoomans Avatar answered Oct 17 '22 00:10

acoomans