如何在expo react本机应用程序中隐藏工具栏。虽然我已将其添加到Header标签中。我附上了代码和截图。
代码:
import React from 'react';
import { ScrollView, StyleSheet } from 'react-native';
import { Container, Header, Item, Input, Icon, Button, Text } from 'native-base';
export default class ScreenScreen extends React.Component {
static navigationOptions = {
title: 'Search',
};
render() {
return (
<Container>
<Header searchBar rounded>
<Item>
<Icon name="ios-search" />
<Input placeholder="Search anything.." />
<Icon name="ios-people" />
</Item>
<Button transparent>
<Text>Search</Text>
</Button>
</Header>
</Container>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 15,
backgroundColor: '#fff',
},
});
Expected toolbar after adding search bar tag in the header tag
答案 0 :(得分:2)
与往常一样,建议阅读您使用的库的文档。
static navigationOptions = {
header: null,
};