Fix Android Keyboard display issue
This commit is contained in:
31
components/keyboards/KeyboardAvoidingComponent.js
Normal file
31
components/keyboards/KeyboardAvoidingComponent.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { View, Text, Platform } from "react-native";
|
||||
import React from "react";
|
||||
import { KeyboardAvoidingView } from "react-native";
|
||||
import { StyleSheet } from "react-native";
|
||||
import { TouchableWithoutFeedback } from "react-native";
|
||||
import { Keyboard } from "react-native";
|
||||
|
||||
const KeyboardAvoidingComponent = ({ children }) => {
|
||||
return (
|
||||
<KeyboardAvoidingView
|
||||
enabled
|
||||
behavior={Platform.OS === "ios" ? "padding":"height" }
|
||||
style={styles.container}
|
||||
>
|
||||
{/* <TouchableWithoutFeedback onPress={Keyboard.dismiss}> */}
|
||||
<View style={styles.inner}>{children}</View>
|
||||
{/* </TouchableWithoutFeedback> */}
|
||||
</KeyboardAvoidingView>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
inner: {
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
|
||||
export default KeyboardAvoidingComponent;
|
||||
Reference in New Issue
Block a user