React 中无法移除输入框边框

问题描述 投票:0回答:1

我一直在尝试删除点击输入框时出现的黑框,但它并没有消失

  const renderSearch = () => {
    return (
      <View style={styles.searchSection}>
        <FaSearch style={styles.searchIcon} />
        <TextInput
          value={searchValue}
          onChangeText={(text) => onSearch(text)}
          placeholder="Search for a restaurant"
          style={styles.input}
        />
      </View>
    )
  }

  input: {
    flex: 1,
    height: '100%',
    width: '100%',
    color: '#424242',
    backgroundColor: 'transparent',
    borderWidth: 0, // Eliminar el borde
    padding: 0, // Eliminar el relleno
    fontSize: 16 // Ajustar el tamaño de la fuente según sea necesario
  },

移除黑匣子

javascript reactjs react-native
1个回答
0
投票

您指的是

outline
吗?当您专注于输入时出现的边框。

如果是这样,请尝试在您的输入中添加此 css:

  outline: none;
© www.soinside.com 2019 - 2024. All rights reserved.