iOS development ui--Keyboard pop-up screen move up

Source: Internet
Author: User

Usually in development, when there is an input box, the pop-up keyboard will sometimes block the bottom of the screen, for this we can in the operation of the input box to move the screen, to avoid the screen below is obscured. (You can also use ScrollView to slide.) ) #pragma  mark -  on-screen bounce-(void) textfielddidbeginediting: (uitextfield *) textfield{     //Keyboard height 216        //slide effect (animation)      nstimeinterval animationduration = 0.30f;    [uiview beginanimations:@ "Resizeforkeyboard"  context:nil];    [uiview setanimationduration: animationduration];        //move the y-coordinate of the view up so that the following space is available for soft keyboard display      self.view.frame = cgrectmake (0.0f, -100.0f, self.view.frame.size.width,  Self.view.frame.size.height);//64-216            [ Uiview commitanimations];} #pragma  mark -screen recovery-(void) textfielddidendediting: (uitextfield *) textfield{     //Slide Effect    &NBSp nstimeinterval animationduration = 0.30f;    [uiview beginanimations:@ "Resizeforkeyboard"  context:nil];    [uiview setanimationduration: animationduration];        //Recovery Screen      Self.view.frame = cgrectmake (0.0f, 0.0f, self.view.frame.size.width,  Self.view.frame.size.height);//64-216            [ Uiview commitanimations];}


iOS development ui--Keyboard pop-up screen move up

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.