Git Product home page Git Product logo

lxmkeyboardmanager's Introduction

LXMKeyboardManager

一个通过监听键盘然后调整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.

lxmkeyboardmanager's People

Contributors

phelthas avatar

Watchers

James Cloos avatar Kevin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.