How can I make a button over the keyboard by default using React Native? I mean the buttons for the Native keyboard (do not change the keyboard, just add as the prefix above)
Use KeyboardAvoidingView
component from react-native
like this
import React, { Component } from 'react';
import { View, Text, KeyboardAvoidingView, TextInput } from 'react-native';
import { Header } from 'react-native-elements';
class App extends Component {
render() {
return (
<View style={{ flex: 1, backgroundColor: 'white' }}>
<Header
outerContainerStyles={{ ... }}
centerComponent={(
<Text style={{ ... }}>
Test Screen
</Text>
)}
/>
<View style={{ flex: 1 }}>
<TextInput
style={{ ... }}
value={ ... }
onChangeText={() => { }}
/>
</View>
<KeyboardAvoidingView
behavior='padding'
style={{ backgroundColor: '#4099FF' }}
>
<Text>
Toolbar
</Text>
</KeyboardAvoidingView>
</View>
);
}
}
export default App;
Then you have this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With