iOS keyboard monitor

Source: Internet
Author: User

1         // Monitor Keyboard 2         Object : nil]; 3         4         object: nil];

1 #pragmaMark-Keyboard handling2 3 /**4 * Keyboard is about to be hidden5  */6- (void) Keyboardwillhideaction: (Nsnotification *) Note7 {8     9     //1. Time required for keyboard popupTenCGFloat Duration =[Note.userinfo[uikeyboardanimationdurationuserinfokey] doublevalue]; One      A     //2. Animations -[UIView animatewithduration:duration animations:^{ -Self.view.transform =cgaffinetransformidentity; the     }]; - } -  - /** + * Keyboard is about to pop up -  */ +- (void) Keyboardwillshowaction: (Nsnotification *) Note A { at      -     //1. Time required for keyboard popup -CGFloat Duration =[Note.userinfo[uikeyboardanimationdurationuserinfokey] doublevalue]; -      -     //2. Animations -[UIView animatewithduration:duration animations:^{ in         //Remove the keyboard height -CGRect KEYBOARDF =[Note.userinfo[uikeyboardframeenduserinfokey] cgrectvalue]; toCGFloat Keyboardh = keyboardF.size.height- +; +         if(threeinch) { -Self.view.transform = Cgaffinetransformmaketranslation (0, -Keyboardh); the}Else { *Self.view.transform = Cgaffinetransformmaketranslation (0, - -); $         }Panax Notoginseng     }]; -}

iOS keyboard monitor

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.