user14663003
user14663003

Reputation:

How to put searchbar into header - react-native-elements

i don't know how to put searchbar into header

This is my code

  render() {
    return (
      <View >
        <Header
            centerComponent={<SearchBar></SearchBar>}
        />
      </View>
    );
  } 
}

and looks like this

enter image description here

Upvotes: 1

Views: 1195

Answers (1)

Pubudu Jayasanka
Pubudu Jayasanka

Reputation: 1462

I think the search bar is already inside the header component, but the search bar's size is bigger than the header height. You can check it with the inspect element in the browser. Try to increase the height of the header

You can improve the code like this

 <Header centerComponent={<SearchBar/>} />

Upvotes: 1

Related Questions