Latest 0.0.1
Homepage https://github.com/Phelthas/LXMKeyboardManager
License MIT
Platforms ios 5.0, requires ARC
Frameworks Foundation, UIKit
Authors

一个通过监听键盘然后调整textField位置使之不会被键盘挡住的工具类
效果图如下:
效果图

inpired by TPKeyboardAvoiding

Installation

requires iOS5.0 or later

Using cocoaPods

1, add the LXMKeyboardManager pod to your Podfile

pod 'LXMKeyboardManager', '~> 0.0.1'   

2, run pod install

3, import the LXMKeyboardManager.h header file, Typically, this should be written as #import <LXMKeyboardManager.h>

Manually

1, add LXMKeyboardManager.h and LXMKeyboardManager.m in your project
2, import the LXMKeyboardManager.h header file

How to Use

1, init a keyboardManager in viewDidAppear like this:

if (!self.keyboardManager) {
    self.keyboardManager = [[LXMKeyboardManager alloc] initWithScrollView:self.scrollView];
}

2, call - (void)scrollToIdealPositionWithTargetView:(UIView *)argView; in UITextFieldDelegate method like this:

#pragma mark - UITextFieldDelegate
- (void)textFieldDidBeginEditing:(UITextField *)textField {
    [self.keyboardManager scrollToIdealPositionWithTargetView:textField];
}

Issues & Contributions

if you have any problem, suggestion or other comment, just tell me and maybe we could work it out together

License

LXMKeyboardManager is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LXMKeyboardManager",
    "version": "0.0.1",
    "summary": "u4e00u4e2au901au8fc7u76d1u542cu952eu76d8u7136u540eu8c03u6574textFieldu4f4du7f6eu4f7fu4e4bu4e0du4f1au88abu952eu76d8u6321u4f4fu7684u5de5u5177u7c7b.",
    "description": "                   u5728u767bu5f55u4e4bu7c7bu7684u9875u9762u91ccu8fd9u662fu4e2au5f88u5e38u89c1u7684u9700u6c42uff0cu6bcfu6b21u90fdu91cdu65b0u5199u952eu76d8u7684u901au77e5u5b8cu5168u6ca1u6709u5fc5u8981uff0cu6240u4ee5u5c01u88c5u4e00u4e0bu65b9u4fbfu4ee5u540eu590du7528u3002n",
    "homepage": "https://github.com/Phelthas/LXMKeyboardManager",
    "license": "MIT",
    "authors": {
        "Phelthas": "[email protected]"
    },
    "platforms": {
        "ios": "5.0"
    },
    "source": {
        "git": "https://github.com/Phelthas/LXMKeyboardManager.git",
        "tag": "0.0.1"
    },
    "source_files": "LXMKeyboardManager/*",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This