Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luobin23628/tkkeyboard
A custom keyboard
https://github.com/luobin23628/tkkeyboard
Last synced: 8 days ago
JSON representation
A custom keyboard
- Host: GitHub
- URL: https://github.com/luobin23628/tkkeyboard
- Owner: luobin23628
- Created: 2014-07-31T14:30:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-12T07:14:05.000Z (about 10 years ago)
- Last Synced: 2024-11-08T00:16:00.902Z (2 months ago)
- Language: Objective-C
- Size: 820 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
TKKeyBoard
==========This library provides an alternative to the native iOS keyboard, support customize the look and feel of the keyboard.
_
Features
========* Compatible with ios 5+
* Works like system keyboard.
* Runs on both iPhone and iPad.
* Customize the look of keyboard.
* Automatic orientation.
* MIT License (you can use it for commercial apps, edit and redistribute).## Usage
You should only import `TKKeyboard.h`
### Use already support keyboard type
Let's start with a simple example
```objective-c
UITextField *textField = [[UITextField alloc] init];
textField.keyboardType = TKKeyboardTypeIntegerPad;
[self.view addSubview:textField];
[textField release];
```
This will display a integer keyboard, as simple as use system keyboard.#### Support keyboard type
* `TKKeyboardTypeIntegerPad`
* `TKKeyboardTypeUIntegerPad`
* `TKKeyboardTypeHexPad`
* `TKKeyboardTypeUnsignedHexPad`
* `TKKeyboardTypeFloatPad`
* `TKKeyboardTypeUnsignedFloatPad`### Customize a keyboard
#### TKKeyboardManager
`TKKeyboardManager` register a keyboard type based on a specified `TKKeyboardConfiguration` object.
#### Creat TKKeyboardConfiguration object
```objective-c
TKKeyboardConfiguration *configiration = [[TKKeyboardConfiguration alloc] init];
configiration.keyboardType = TKKeyboardTypeIntegerPad;
configiration.keyboardHeight = 216;
configiration.backgroundColor = [UIColor colorWithWhite:179/255.0 alpha:1];
```#### Creat Layout object
Layout object is responsible for the layout of the key buttons. The type supported is TKGridLayout and TKFlowLayout, You can also customize a Layout object, which conforms to `TkLayout`.
```objective-c
TKGridLayout *layout = [[TKGridLayout alloc] init];
layout.rowCount = 4;
layout.columnCount = 3;
configiration.layout = layout;
[layout release];
```#### Creat TKKeyItem object
```objective-c
TKKeyItem *keyItem = [[TKKeyItem alloc] initWithInsertText:@"1"];
configiration.keyItems = @[keyItem];
[keyItem release];
```## Maintainers
- [LuoBin](https://github.com/luobin23628) ([Email:[email protected]](mailto:[email protected]?subject=TKKeyboard))
## License
TKKeyboard is available under MIT license. See the LICENSE file for more info.