![](/img/trans.png)
[英]SearchBar from react-native-elements with FlatList only allows me to type characters one by one
[英]Customizing { SearchBar } from 'react-native-elements' as per below image
我正在嘗試使用“react-native-elements”更改搜索欄的樣式,功能方面它正在工作,但是對於樣式,我遇到了一些問題
我的代碼:
<SearchBar
//searchIcon={{ size: 24 }}
onChangeText={text => this.testFilter(text)}
onClear={text => this.testFilter('')}
inputStyle={{ backgroundColor: 'white' }}
containerStyle={{ backgroundColor: '#FFFFFF', borderWidth: 0, marginLeft: 50 }}
inputContainerStyle={{ backgroundColor: '#FFFFFF' }}
placeholderTextColor={'#g5g5g5'}
placeholder={'Search...'}
clearIcon={false}
searchIcon={false}
value={this.state.test}
/>
如何使用 Searchbar 組件實現相同的樣式
你有沒有試過像這樣添加inputContainerStyle
道具?
inputContainerStyle={{ backgroundColor: 'white' }}
您還應該查看searchIcon
和cancelIcon
道具以重新設置默認SearchBar
組件中使用的圖標的樣式。
在對一些邏輯和樣式進行一些更改后設法滿足要求
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.