如何解决无法在React Native Expo中删除TextInput的默认填充
我正在将TextInput组件与自定义字体系列一起使用,并且它具有默认的 paddingBottom ,并且不会在ANDROID上删除。
我尝试添加样式,例如paddingBottom / Vertical:0,includeFontPadding:false和对TextInput的支持,例如TextAlignVertical:“ top”,但仍然无法使用。.
有什么建议吗?
以下是textInput(CodeCard组件)的容器的代码:
const CodeCard = (props) => {
return (
<View>
<View style={styles.container}>
<View style={{ ...props.style }}>{props.children}</View>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
shadowColor: "black",shadowOffset: { width: 0,height: 2 },shadowRadius: 5,shadowOpacity: 0.3,justifyContent: "center",backgroundColor: "white",elevation: 5,paddingHorizontal: 18,borderRadius: 10,},title: {
fontWeight: "bold",fontSize: 21,color: "#20252F",paddingBottom: 5,
这是我正在使用react-native-confirmation-code-input
的自定义TextInput的代码这是带有容器的整个组件的最终代码:
<CodeCard>
<View style={styles.codeInputContainer}>
<CodeInput
keyboardType="numeric"
autoCorrect={false}
/>
</View>
</CodeCard>
codeInputContainer: {
flexDirection: "row",marginTop: 31.5,marginBottom:30.5,paddingHorizontal:0,
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。