navigationOptions 配置隐藏标题栏和实现标题居中
作者:
前端来入坑 | 来源:发表于
2019-04-14 12:02 被阅读0次import { Platform } from "react-native";
const TITLE_OFFSET = Platform.OS === 'ios' ? 70 : 56;
......
...隐藏标题栏
Home: {
screen: Example ,
navigationOptions: {
header: null
}
},
...标题栏的居中显示
Test: {
screen: Example,
navigationOptions: {
title: 'test',
headerTitleStyle:{
textAlign: 'center',
flex:1,
},
headerTitleContainerStyle:{
left: TITLE_OFFSET,
right: TITLE_OFFSET,
}
}
}

隐藏标题栏

标题栏居中
参考https://www.jianshu.com/p/a9a0c64a3b94
本文标题:navigationOptions 配置隐藏标题栏和实现标题居中
本文链接:https://www.haomeiwen.com/subject/okssiqtx.html
网友评论