Skip to content

Correct android settings #66

Answered by mateusz1913
osliver asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @osliver , as stated in documentation, you have to set adjustNothing value for android activity. You can do it in 2 ways:

  • programmatically using setAdjustNothing (I prefer this one)
  • setting it manually in Android manifest file

Example for 1st solution:

const Component = () => {
  // if you use react-navigation and you want to enable it only in current displayed screen
  const onFocusEffect = useCallback(() => {
    AvoidSoftInput.setAdjustNothing(); // <------------------- this will do the trick
    AvoidSoftInput.setEnabled(true);
    return () => {
      AvoidSoftInput.setEnabled(false);
      AvoidSoftInput.setDefaultAppSoftInputMode(); // <------ this will reset, so other screens…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mateusz1913
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants