Возможно, вам не хватает <ScrollView>
, которое требуется, если ваш контент превышает высоту экрана.
Вам также может понадобиться KeyboardAvoidingView
, который гарантирует, что TextInput
не покрыт (или скрыт)за клавиатурой.
Здесь я добавил несколько <View>
для имитации некоторого контента.
import React from "react";
import {
StyleSheet,
View,
TextInput,
ScrollView,
KeyboardAvoidingView
} from "react-native";
export default class App extends React.Component {
render() {
return (
<KeyboardAvoidingView behavior="padding">
<ScrollView>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<TextInput
autoFocus
placeholder="Textinput far below..."
style={{ height: 20, backgroundColor: "red" }}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
<View
style={{
height: 100,
width: 100,
backgroundColor: "rgba(0, 0, 0, 0.3)"
}}
/>
</ScrollView>
</KeyboardAvoidingView>
);
}
}
![InputScroll](https://i.stack.imgur.com/ICHEU.gif)