【问题标题】:How to put searchbar into header - react-native-elements如何将搜索栏放入标题 - react-native-elements
【发布时间】:2020-11-18 15:26:26
【问题描述】:

我不知道如何将搜索栏放入标题

这是我的代码

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

看起来像这样

enter image description here

【问题讨论】:

    标签: reactjs react-native react-native-elements


    【解决方案1】:

    我认为搜索栏已经在标题组件内,但是搜索栏的大小大于标题高度。您可以使用浏览器中的检查元素进行检查。尝试增加表头高度

    你可以像这样改进代码

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-06
      • 2020-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多