У меня есть этот код в React Native для Android. Когда я начинаю вводить текст и появляется клавиатура, элементы пользовательского интерфейса перемещаются. Некоторые элементы пользовательского интерфейса, это не проблема).
Любое добавление клавиш -провидеров не решило проблему.
Как удалить эту функциональность? < /p>
import React from 'react';
import { View, TextInput, Modal, ImageBackground, KeyboardAvoidingView, TouchableOpacity, Image, Platform, StyleSheet, Text } from 'react-native';
const App = () => {
return (
{
}}
>
'123'
'123'
'8'
{
}}
>
{768}
{
}} style={styles.saveButtonOnIncomeScreen}>
{'456'}
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-end',
alignItems: 'center',
bottom: -520,
},
text: {
fontSize: 20,
marginBottom: 10,
},
input: {
height: 50,
width: '80%',
borderColor: 'gray',
borderWidth: 1,
paddingLeft: 10,
borderRadius: 5,
},
imageBackground: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
width: '100%',
resizeMode: 'cover',
},
addDateButtonOnIncomeScreen: {
width: 300,
height: 40,
backgroundColor: '#fff',
borderRadius: 15,
justifyContent: 'center',
alignItems: 'center',
marginBottom: 20,
top: 110,
},
saveButtonOnIncomeScreen: {
width: 300,
height: 40,
backgroundColor: '#ff0030',
borderRadius: 15,
justifyContent: 'center',
alignItems: 'center',
marginBottom: 20,
top: 100,
},
inputIncomeDescription: {
backgroundColor: 'white',
padding: 5,
marginTop: 10,
top: 100,
borderRadius: 15,
width: 300,
height: 40,
textAlign: 'center',
},
inputIncomeAmount: {
backgroundColor: 'white',
padding: 5,
marginTop: 10,
top: 100,
borderRadius: 15,
width: 300,
height: 40,
textAlign: 'center',
},
backButtonOnIncomeScreen:
{
right: 150,
bottom: 117,
},
addingIncomeModalContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
addingIncomeModalContent: {
padding: 20,
borderRadius: 10,
alignItems: 'center',
},
textWithNumberOnIncomeScreen: {
color: 'white',
fontWeight: 'bold',
fontSize: 60,
top: -5,
},
headerForNewIncomeWindow: {
color: 'white',
fontWeight: 'bold',
fontSize: 20,
top: -140,
},
headerForTextWithNumberOnIncomeScreen: {
color: 'white',
fontWeight: 'bold',
fontSize: 20,
top: -10,
},
roundedRectangleInIncomeView: {
backgroundColor: '#ebf1f4',
width: '100%',
borderTopLeftRadius: 40,
borderTopRightRadius: 40,
borderBottomLeftRadius: 0,
borderBottomRightRadius: 0,
position: 'absolute',
bottom: 0,
transform: [{ scale: 1 }]
},
});
export default App;
Подробнее здесь: https://stackoverflow.com/questions/794 ... laces-when
Отрешите Native для Android, как сделать элементы пользовательского интерфейса, остаются в одних и тех же местах, когда ⇐ Android
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение