![](/img/trans.png)
[英]React Native Expo - Custom Text Input has placeholder and input aligned vertically on iOS but not Android
[英]React Native Input Field Placeholder not work in iOS
这是我的代码。 android方面很好,但iOS不起作用。
applyLetterSpacing(string, count = 1) {
return string.split('').join('\u200A'.repeat(count));
}
<Item style={borderUnderLine}>
<Input
placeholder={this.applyLetterSpacing('NAME')}
autoCapitalize='none'
returnKeyType='next'
onChangeText={(value) => this.setState({ name: value })}
blurOnSubmit={false}
style={{ letterSpacing: 2 }}
/>
</Item>
使用箭头功能进行applyLetterSpacing
applyLetterSpacing = (string, count = 1) => {
return string.split('').join('\u200A'.repeat(count));
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.