导航到场景并且没有返回显示
Navigate to scene and not have back show up
我正在构建一个头像生成器,但我在实施 react-native-router-flux 时遇到了一些问题。在下面的示例中,我让用户登陆 "home"。他们访问 race 场景,然后将他们发送到 subrace 场景。我的问题是当我选择完一个子种族后,我使用 Actions.home 将它们送回家。它把他们带回家,而且还启用了后退按钮。任何帮助将不胜感激。
export default class App extends Component {
render() {
return (
<Router>
<Scene key= 'root'>
<Scene key= "home" hidenavbar={true} component={HomeScreen} title="Create Character" initial={true} />
<Scene key= "race" component={Race} title="Choose Race" />
<Scene key= "subrace" component={Subrace} title="Choose Subrace" />
</Scene>
</Router>
);
}
}
下面是子种族成分
export default class Subrace extends Component {
render(){
return (
<Container>
<Header><Title>Choose Subrace</Title></Header>
<Content>
<List>
<ListItem button onPress = {Actions.home}>
<Thumbnail square size={80}/>
<Text>Underground elf</Text>
</ListItem>
<ListItem button onPress = {Actions.home}>
<Thumbnail square size={80} />
<Text>forest elf</Text>
</ListItem>
</List>
</Content>
</Container>
);
}
}
试试这个:
export default class Subrace extends Component {
render(){
return (
<Container>
<Header><Title>Choose Subrace</Title></Header>
<Content>
<List>
<ListItem button onPress={() => Actions.home({ type: 'reset' })}>
<Thumbnail square size={80}/>
<Text>Underground elf</Text>
</ListItem>
<ListItem button onPress={() => Actions.home({ type: 'reset' })}>
<Thumbnail square size={80} />
<Text>forest elf</Text>
</ListItem>
</List>
</Content>
</Container>
);
}
}
我正在构建一个头像生成器,但我在实施 react-native-router-flux 时遇到了一些问题。在下面的示例中,我让用户登陆 "home"。他们访问 race 场景,然后将他们发送到 subrace 场景。我的问题是当我选择完一个子种族后,我使用 Actions.home 将它们送回家。它把他们带回家,而且还启用了后退按钮。任何帮助将不胜感激。
export default class App extends Component {
render() {
return (
<Router>
<Scene key= 'root'>
<Scene key= "home" hidenavbar={true} component={HomeScreen} title="Create Character" initial={true} />
<Scene key= "race" component={Race} title="Choose Race" />
<Scene key= "subrace" component={Subrace} title="Choose Subrace" />
</Scene>
</Router>
);
}
}
下面是子种族成分
export default class Subrace extends Component {
render(){
return (
<Container>
<Header><Title>Choose Subrace</Title></Header>
<Content>
<List>
<ListItem button onPress = {Actions.home}>
<Thumbnail square size={80}/>
<Text>Underground elf</Text>
</ListItem>
<ListItem button onPress = {Actions.home}>
<Thumbnail square size={80} />
<Text>forest elf</Text>
</ListItem>
</List>
</Content>
</Container>
);
}
}
试试这个:
export default class Subrace extends Component {
render(){
return (
<Container>
<Header><Title>Choose Subrace</Title></Header>
<Content>
<List>
<ListItem button onPress={() => Actions.home({ type: 'reset' })}>
<Thumbnail square size={80}/>
<Text>Underground elf</Text>
</ListItem>
<ListItem button onPress={() => Actions.home({ type: 'reset' })}>
<Thumbnail square size={80} />
<Text>forest elf</Text>
</ListItem>
</List>
</Content>
</Container>
);
}
}