KeyboardToolBar 2.0.1

KeyboardToolBar 2.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2016年1月

KeyboardToolBar维护。



  • 作者
  • Jiar

什么是KeyboardToolBar

不再需要担心键盘遮挡输入框,这就是KeyboardToolBar的核心。它易于在iPhone和iPad上使用。
KeyboardToolBar2 show

如何开始使用

  • 下载KeyboardToolBar并尝试运行包含iPhone示例应用的源代码。

Podfile

platform :ios, '7.0'
pod "KeyboardToolBar"

使用

现在,KeyboardToolBar已支持运行时,您只需导入"KeyboardToolBar.h"即可开始使用,无需额外代码。

导入

/// import is use
#import "KeyboardToolBar.h"

registerKeyboardToolBar

/// register the UITextField to use the KeyboardToolBar.
[KeyboardToolBar registerKeyboardToolBarWithTextField:self.textField]; // self.textField is a UITextField
/// register the UITextView to use the KeyboardToolBar.
[KeyboardToolBar registerKeyboardToolBarWithTextView:self.textView]; // self.textView is a UITextView
/// register the UISearchBar to use the KeyboardToolBar.
[KeyboardToolBar registerKeyboardToolBarWithSearchBar:self.searchBar]; // self.searchBar is a UISearchBar

unregisterKeyboardToolBar

/// you can unregister the UITextField when you never use the KeyboardToolBar again.
[KeyboardToolBar unregisterKeyboardToolBarWithTextField:self.textField];
/// you can unregister the UITextView when you never use the KeyboardToolBar again.
[KeyboardToolBar unregisterKeyboardToolBarWithTextView:self.textView];
/// you can unregister the UISearchBar when you never use the KeyboardToolBar again.
[KeyboardToolBar unregisterKeyboardToolBarWithSearchBar:self.searchBar];

KeyboardToolBar是什么

KeyboardToolBar的主旨:不再担心键盘遮挡输入框。目前是V2版本,如果想了解V1版本,请参考V1版本

如何开始使用

  • 下载KeyboardToolBar并在您的iPhone上运行DEMO。

Podfile

platform :ios, '7.0'
pod "KeyboardToolBar"

使用

现在,KeyboardToolBar支持UITextField、UITextView和UISearchBar。并且支持运行时(runtime),您只需在项目中导入"KeyboardToolBar.h"即可开始使用,无需额外代码。

导入

/// 导入就是使用
/// 导入后,将自动为UITextField、UITextView和UISearchBar注册使用KeyboardToolBar
#import "KeyboardToolBar.h"

注册使用KeyboardToolBar

/// 以下均为可选方法,你可以不使用。
/// 为UITextField注册使用KeyboardToolBar.
[KeyboardToolBar registerKeyboardToolBarWithTextField:self.textField];
/// 为UITextView注册使用KeyboardToolBar.
[KeyboardToolBar registerKeyboardToolBarWithTextView:self.textView];
/// 为UISearchBar注册使用KeyboardToolBar.
[KeyboardToolBar registerKeyboardToolBarWithSearchBar:self.searchBar];

反注册取消KeyboardToolBar

/// 以下均为可选方法,你可以不使用。
/// 你可以为目标UITextField反注册取消使用KeyboardToolBar
[KeyboardToolBar unregisterKeyboardToolBarWithTextField:self.textField];
/// 你可以为目标UITextView反注册取消使用KeyboardToolBar
[KeyboardToolBar unregisterKeyboardToolBarWithTextView:self.textView];
/// 你可以为目标UISearchBar反注册取消使用KeyboardToolBar
[KeyboardToolBar unregisterKeyboardToolBarWithSearchBar:self.searchBar];

许可

KeyboardToolBar遵循MIT许可证发布。