ios - Stick element to the keyboard bottom during animations -


i'm struggling keyboard in ios 8 trying glue element above during animations. in messages have input pushing appearing keyboard. i've found lots of topics here, of them how handle appearing keyboard, not dismissal. seems apple use other curve or speed whatever dismissal, have asynchronism when close keyboard, while appearing animation synchronised.

here i've got now:

[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardwillhideorshow:) name:uikeyboardwillshownotification object:nil]; [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(keyboardwillhideorshow:) name:uikeyboardwillhidenotification object:nil];  - (void)keyboardwillhideorshow:(nsnotification *)note {     nsdictionary *userinfo = note.userinfo;     cgrect keyboardendframe = [userinfo[uikeyboardframeenduserinfokey] cgrectvalue];     [self adjustformcontainersize]; // method opening orange card      uiviewanimationcurve curve = [userinfo[uikeyboardanimationcurveuserinfokey] unsignedintegervalue];     uiviewanimationoptions options = (curve << 16) | uiviewanimationoptionbeginfromcurrentstate;     nstimeinterval duration = [userinfo[uikeyboardanimationdurationuserinfokey] doublevalue];      self.buttoncontainerbottom.constant = keyboardendframe.size.height;     [uiview animatewithduration:duration                           delay:0.0                         options:options                      animations:^{                          [self.view layoutifneeded];                      }                      completion:nil]; } 

and result in simulator: http://monosnap.com/file/bwxjdthpgzcqjnxeqleg5bb8smvxdb

what's wrong backward animation, how synchronise it?

i recommend use

dakeyboard

it's component handle problem


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -