TTKeyboardphobia 0.1.0

TTKeyboardphobia 0.1.0

测试测试过
语言语言 Obj-CObjective C
许可协议 BSD
发布最新版本2015年8月

Ian Leitch 维护。



  • 作者
  • Ian Leitch

使用说明

#import "TTKeyboardphobia.h"

- (void)viewDidLoad {
    [super viewDidLoad];
    self.keyboardphobia = [[TTKeyboardphobia alloc] init];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.keyboardphobia registerView:self.textView inScrollView:self.scrollView];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self.keyboardphobia unregisterViews];
    # Or, to unregister just a single view:
    # [self.keyboardphobia unregisterView:self.textView];
}

您也可以在容器视图中嵌套输入视图,此时 TTKeyboardphobia 将将容器视图的框架对齐到键盘的顶部边缘。只需注册您的容器而不是直接注册输入视图即可

[self.keyboardphobia registerView:self.textViewContainer inScrollView:self.scrollView];

TTKeyboardphobia 会搜索视图层次结构以找到第一个响应者,所以您可以选择在多个容器视图中嵌套输入。

安装

TTKeyboardphobia 通过 CocoaPods 提供。要安装它,请将以下行添加到您的 Podfile

pod "TTKeyboardphobia"

作者

Ian Leitch, [email protected]

许可协议

TTKeyboardphobia 在 BSD 许可下提供。有关更多信息,请参阅 LICENSE 文件。