mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 09:23:16 +08:00
Rework the NavigationHeader
Reviewed By: dmmiller, ericvicenti Differential Revision: D3000972 fb-gh-sync-id: fcd4e63b72a70440e611289f03ed4757e230dc5b shipit-source-id: fcd4e63b72a70440e611289f03ed4757e230dc5b
This commit is contained in:
committed by
Facebook Github Bot 4
parent
eb531943aa
commit
8717b2d19c
@@ -28,6 +28,7 @@ const {
|
||||
Container: NavigationContainer,
|
||||
RootContainer: NavigationRootContainer,
|
||||
Header: NavigationHeader,
|
||||
HeaderTitle: NavigationHeaderTitle,
|
||||
Reducer: NavigationReducer,
|
||||
View: NavigationView,
|
||||
} = NavigationExperimental;
|
||||
@@ -154,13 +155,15 @@ class ExampleTabScreen extends React.Component {
|
||||
/>
|
||||
);
|
||||
}
|
||||
_renderHeader(props) {
|
||||
|
||||
_renderHeader(scenes, index, position, layout) {
|
||||
return (
|
||||
<NavigationHeader
|
||||
navigationState={props.navigationParentState}
|
||||
position={props.position}
|
||||
layout={props.layout}
|
||||
getTitle={state => stateTypeTitleMap(state)}
|
||||
scenes={scenes}
|
||||
index={index}
|
||||
position={position}
|
||||
layout={layout}
|
||||
renderTitleComponent={pageState => <NavigationHeaderTitle>{stateTypeTitleMap(pageState)}</NavigationHeaderTitle>}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -270,7 +273,7 @@ const styles = StyleSheet.create({
|
||||
flex: 1,
|
||||
},
|
||||
scrollView: {
|
||||
marginTop: 64
|
||||
marginTop: NavigationHeader.APPBAR_HEIGHT + NavigationHeader.STATUSBAR_HEIGHT,
|
||||
},
|
||||
tabContent: {
|
||||
flex: 1,
|
||||
|
||||
Reference in New Issue
Block a user