React native TextInput的borderRadius属性在react native中不起作用。
我想在react本机应用程序中使用rounded TextInput,但当我设置其borderRadius属性时,它不起作用。建议我怎么做React native TextInput的borderRadius属性在react native中不起作用。,react-native,React Native,我想在react本机应用程序中使用rounded TextInput,但当我设置其borderRadius属性时,它不起作用。建议我怎么做 <TextInput placeholder="Email" style={styles.textInput} /> textInput:{ borderColor:'black', backgroundColor:'#D3D3D3', width:300, borderWidth: 1,
<TextInput placeholder="Email" style={styles.textInput} />
textInput:{
borderColor:'black',
backgroundColor:'#D3D3D3',
width:300,
borderWidth: 1,
borderStyle: 'solid',
fontSize:15,
borderRadius: 25,
}
文本输入:{
边框颜色:'黑色',
背景颜色:“#D3”,
宽度:300,
边框宽度:1,
边框样式:“实心”,
尺寸:15,
边界半径:25,
}
在视图
上应用边框,该视图是文本输入
<View style={styles.borderStyle}>
<TextInput placeholder="Email" style={styles.textInput} />
</View>
在具有borderRadius的文本输入上尝试溢出:“隐藏”
。应用以下代码:
<TextInput
style={{ height: 40, width: "95%", borderColor: 'gray', borderWidth: 2, borderRadius: 20, marginBottom: 20, fontSize: 18 }}
// Adding hint in TextInput using Placeholder option.
placeholder=" Enter Your First Name"
// Making the Under line Transparent.
underlineColorAndroid="transparent"
/>
我做到了。但是,为什么textInput中的borderRadius属性在react native中的按钮上起作用却不起作用呢@Shukarullah ShahBecause borderRadius是视图样式属性,它不适用于textInput。这是官方文档,对于样式备忘单,它有关于什么样式应用于什么本地元素的良好信息