Andr3wHur5t / react-native-keyboard-spacer

Plug and play react-native keyboard spacer view.
MIT License
1.56k stars 219 forks source link

Get height of smaller view #13

Closed danvass closed 8 years ago

danvass commented 8 years ago

@Andr3wHur5t Is it possible to get the height of the smaller view that is created once the keyboard is displayed?

Andr3wHur5t commented 8 years ago

There should only be one view created by this component.

If you provide an example I may be able to provide some insight though.

danvass commented 8 years ago

@Andr3wHur5t Sorry I described it poorly, I am trying to get the height of the screen minus the height of the keyboard.

danvass commented 8 years ago

@Andr3wHur5t In addition toggle state seems to only return true. Fixed this and sent pull request #14 .

Andr3wHur5t commented 8 years ago

You should be able to sample the keyboardSpacer when the on change event is called while simultaneously sampling the superviews size using the Dimensions class in react native.

The delta should be what your looking for, the keyboard spacer size should always be 0 when the keyboard is hidden unless it explicitly set outside of the module.

Andr3wHur5t commented 8 years ago

Just published your PR to NPM, marking this as closed.

danvass commented 8 years ago

@Andr3wHur5t Thanks, I just decided to add another parameter to the toggleState function instead and sent through a PR. Thanks for the lib!

Andr3wHur5t commented 8 years ago

Thanks for the PR, glad people are using it :)