Skip to content

Instantly share code, notes, and snippets.

@jondot
Created January 14, 2016 16:49
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jondot/1317ee27bab54c482e87 to your computer and use it in GitHub Desktop.
Save jondot/1317ee27bab54c482e87 to your computer and use it in GitHub Desktop.
ios keyboard bezier
  onKeyboardWillHide(e) {
    Animated.timing(this.state.height, {
      toValue: this.listViewMaxHeight,
      duration: e.duration,
      easing: Easing.bezier(0.1, 0.76, 0.55, 0.9)
    }).start();
  },

  onKeyboardWillShow(e) {
    Animated.timing(this.state.height, {
      toValue: this.listViewMaxHeight - (e.endCoordinates ? e.endCoordinates.height : e.end.height),
      duration: e.duration,
      easing: Easing.bezier(0.1, 0.76, 0.55, 0.9)
    }).start();
  },
@zachgibson
Copy link

Do you know anything about what easing is doing in this screenshot? You use e.duration, is there something in here to get the exact easing curve that the keyboard has?

image

@mattyclarkson
Copy link

@romchambe
Copy link

Thanks for that, very useful

@muuvmuuv
Copy link

Whats the duration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment