[英]Text in TextInput not in correct position on ios
我在一个使用flex
放置在中心的View
有一个textInput
。 问题是,当您开始在textInput
编写内容时,即使我没有那样设置样式,文本也会居中...
初始光标位于正确的位置,但是一旦用户开始键入,文本就会居中。
奇怪的是,这个问题仅与ios有关,而不与android有关。
我尝试添加textAlign: left
样式,但是没有任何作用。 我在做什么错,该如何解决?
这是项目的链接 : https : //snack.expo.io/S1PlOqFvN
import React from 'react';
import { StyleSheet, Text, View, TextInput } from 'react-native';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<TextInput style={styles.textFieldStyling} placeholder="Try typing something..."></TextInput>
<Text style={styles.textStyling}></Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'orange',
alignItems: 'center',
justifyContent: 'center',
},
textStyling: {
fontSize: 50,
textAlign: 'center',
},
textFieldStyling: {
color: 'blue',
},
});
React Native中的TextInput没有关闭标签
<TextInput
style={styles.textFieldStyling}
placeholder="Try typing something..."
/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.