如何在react-native-element中获得此搜索栏样式?

时间:2018-04-16 02:13:35

标签: react-native styles stylesheet

它基本上是来自react-native-elements的搜索栏组件,其中容器背景颜色为白色,占位符字段具有半径边框。

不确定react-native-element是否允许为占位符提供样式。 任何其他方式我可以使用样式和react-native-elements搜索栏组件来获得此结果?

enter image description here

1 个答案:

答案 0 :(得分:3)

您需要修改inputcontainer样式

 <SearchBar
    inputStyle={{backgroundColor: 'white'}}
    containerStyle={{backgroundColor: 'white', borderWidth: 1, borderRadius: 5}}
    placeholderTextColor={'#g5g5g5'}
    placeholder={'Pritish Vaidya'}
/>

检查docs以获取更多道具,然后您可以提供自己的Icon