小编alb*_*rta的帖子

React Native Elements Searchbar边框线未清除

我正在使用反应原生元素搜索栏,我正在努力让顶部和底部的这两条小线条消失 - 我无法弄清楚它们是什么:

这里奇怪的格式化搜索栏图像

这是我的搜索栏代码:

    <SearchBar placeholder="Search contacts..." 
        data={this.state.searchResultFriendsList}
        ref={(ref) => this.searchBar = ref}
        style= {styles.searchbar} 
        lightTheme round 
        containerStyle={styles.searchcontainer}
    />
Run Code Online (Sandbox Code Playgroud)

这是我的两个样式片段:

searchcontainer: {
    backgroundColor: 'white',
    borderWidth: 0, //no effect
    shadowColor: 'white', //no effect
},
searchbar: {
    width: "100%",
    backgroundColor: 'red', //no effect
    borderWidth:0, //no effect
    shadowColor: 'white', //no effect
},
Run Code Online (Sandbox Code Playgroud)

如果我将主题更改为lightTheme默认值,则线条会变为深灰色,因此我知道它与SearchBar元素本身有关,但无法通过更改边框或阴影来消除它.

想知道是否有人之前经历过这样的事情,提前谢谢!

react-native

7
推荐指数
2
解决办法
2941
查看次数

标签 统计

react-native ×1