我正在开发一个本机应用程序。我使用了react-native-elements库。 SearchBar组件不带图标属性。我也导入了react-native-vector-icon包。如何将图标添加到SearchBar?
<SearchBar
placeholder="Type Comment"
inputStyle={[styles.searchBar]}
// noIcon={true}
icon = {{type: 'MaterialCommunityIcons', color: '#86939e', name: 'share' }}
clearIcon = {{type: 'MaterialCommunityIcons', color: '#86939e', name: 'share' }}
round={true}
答案 0 :(得分:1)
查看add an index,我认为docs应该是MaterialCommunityIcons
而不是<SearchBar
placeholder="Type Comment"
inputStyle={[styles.searchBar]}
// noIcon={true}
icon = {{type: 'material-community', color: '#86939e', name: 'share' }}
clearIcon = {{type: 'material-community', color: '#86939e', name: 'share' }}
round={true}
os.environ.get()