The solution provided in this thread is applicablle to all the screens but I need to implement it only on some specific screen how to do this ?
I tried below things but they are impact all the screens
screenOptions={{
tabBarHideOnKeyboard: true,
}}
<application
<activity
<!-- android:windowSoftInputMode="adjustResize" Added this -->
</activity>
</application>
1 Answer 1
This can be resolved by wraping the Screen Content that is showing the keyboard, with KeyboardAvoidingView as shown in below example:
import { KeyboardAvoidingView, Platform, ScrollView } from 'react-native';
function MyScreen() {
return (
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={{ flex: 1 }}
>
<ScrollView>
{/* Screen content goes here */}
</ScrollView>
</KeyboardAvoidingView>
);
}
Keep in mind to use the behaviour property as it is shown in the example.
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
screenOptionsprop reactnavigation.org/docs/bottom-tab-navigator/#tabbarstyle