我已经创建了标题标题和使用本机基础右图标。但是,在我的模拟器上显示了两个标题。我不知道发生了什么。有人能帮我一下吗?
import React, { Component }from 'react';
import { StyleSheet } from 'react-native';
import { Icon, Button, Container, Header, Content, Left, Right, Body,Text, Title } from 'native-base';
class Landing extends Component {
render() {
return (
<Container>
<Header>
<Left />
<Body>
<Title>
Title
</Title>
</Body>
<Right>
<Button transparent>
<Icon name="ios-menu" onPress={() =>
this.props.navigation.navigate('DrawerOpen')} />
</ Button>
</Right>
</Header>
<Content contentContainerStyle={{
flex: 1,
alignItems: 'center',
justifyContent: 'center'
}}>
<Text>
Landing Screen
</Text>
</ Content>
</ Container>
);
}
}
export default Landing;这是我的代码,我看到了类似图片的东西:enter image description here
发布于 2018-06-30 02:24:37
我认为您正在使用StackNavigator。
如果是,则更改为:
const Navigator = StackNavigator(
{
Landing: { screen: Landing},
Home: { screen: Home}
},
{
headerMode: 'none'
}
);发布于 2018-06-30 05:38:13
如果您是react-navigation用户,则必须按如下方式设置导航选项:
static navigationOptions = {
header: null
};发布于 2019-05-15 19:45:31
在react-router-flux中,与路由/导航器中接受的答案的概念相同:
<Scene
key='dashboardContainer'
component={(localProps) => <DashboardContainer {...props} {...localProps} />}
hideNavBar
/>https://stackoverflow.com/questions/51105386
复制相似问题