So I need to align a button Which is not at bottom om screen by design should be at middle of screen but it should align to be on top of the keyboard for all de
First import this packages
import {
Button,
ScrollView,
KeyboardAvoidingView,
TextInput,
} from 'react-native';
Render method
This are the styles
const styles = StyleSheet.create({
container: {
flex: 1,
},
scrollView: {
paddingHorizontal: 20,
},
input: {
marginBottom: 20,
borderBottomWidth: 2,
borderColor: '#dbdbdb',
padding: 10,
},
});
Make sure the button is outside the scrollview.
NOTE: You may need to adjust the offset prop of
KeyboardAvoidingViewif the keyboard has got autocomplete enabled.
Stick button at the bottom of the screen demo