加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-native – React Native Elements Searchbar边框线未清除

发布时间:2020-12-15 20:16:09 所属栏目:百科 来源:网络整理
导读:我正在努力研究 react native elements searchbar并且正努力让这两条小线在顶部和底部消失 – 我无法弄清楚它们是什么: Weirdly formatted Searchbar image here 这是我的搜索栏代码: SearchBar placeholder="Search contacts..." data={this.state.search
我正在努力研究 react native elements searchbar并且正努力让这两条小线在顶部和底部消失 – 我无法弄清楚它们是什么:

Weirdly formatted Searchbar image here

这是我的搜索栏代码:

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

这是我的两个样式片段:

searchcontainer: {
    backgroundColor: 'white',borderWidth: 0,//no effect
    shadowColor: 'white',//no effect
},searchbar: {
    width: "100%",backgroundColor: 'red',//no effect
    borderWidth:0,

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

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

解决方法

使用borderBottomColor和borderTopColor作为透明的searchcontainer

searchcontainer: {
 backgroundColor: 'white',//no effect
 shadowColor: 'white',//no effect
 borderBottomColor: 'transparent',borderTopColor: 'transparent'
}

希望这会有所帮助

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读