Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native TextInput的borderRadius属性在react native中不起作用。_React Native - Fatal编程技术网

React native TextInput的borderRadius属性在react native中不起作用。

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,

我想在react本机应用程序中使用rounded TextInput,但当我设置其borderRadius属性时,它不起作用。建议我怎么做

    <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。这是官方文档,对于样式备忘单,它有关于什么样式应用于什么本地元素的良好信息