React native 多行文本输入占位符未居中对齐
当“multiline”设置为true时,占位符不位于中心。如何将占位符放置在中心,并确保光标在占位符文本之前启动(类似于非多行文本输入中的占位符文本)?我希望文本输入的宽度为100%React native 多行文本输入占位符未居中对齐,react-native,React Native,当“multiline”设置为true时,占位符不位于中心。如何将占位符放置在中心,并确保光标在占位符文本之前启动(类似于非多行文本输入中的占位符文本)?我希望文本输入的宽度为100% class Something extends Component { render() { return ( <View style={{paddingTop: 20}}> <TextInput placeholder="Single-Line" style={styles.inp
class Something extends Component {
render() {
return (
<View style={{paddingTop: 20}}>
<TextInput placeholder="Single-Line" style={styles.input}/>
<TextInput placeholder="Multi-line" style={[styles.input,{backgroundColor: 'pink'}]} multiline={true}/>
</View>
)
}
}
const styles = StyleSheet.create({
input: {
height: 30,
textAlign: 'center',
backgroundColor: 'red'
}
});
类扩展组件{
render(){
返回(
)
}
}
const styles=StyleSheet.create({
输入:{
身高:30,
textAlign:'中心',
背景颜色:“红色”
}
});
这可能是React native中RCTTextView的一个错误。multiline=false使用RCTTextField,multiline=true使用RCTTextView。