【发布时间】:2019-10-13 23:30:09
【问题描述】:
如果我设置headerTransparent: true,通常在其下方呈现的其他内容将移动到其下方。我怎样才能避免这种情况?
我的代码:
export class RegisterScreen extends Component {
static navigationOptions = {
title: strings.header,
headerTitleStyle: { color: '#fff' },
headerTintColor: '#fff',
headerTransparent: true,
};
render() {
return <Display onSignUpPressed={() => {}} onHelpPressed={() => {}} />;
}
}
带有透明标题(它重叠:():
没有透明标题:
我想让内容对齐,就好像标题有高度一样。所以我希望内容像第二张图片一样,但标题像第一张一样透明。
【问题讨论】:
-
添加一个
样式可以是:statusBar: { backgroundColor: "#C2185B", width: "100%", height: Constants.statusBarHeight } -
尝试添加headerBackground
标签: react-native react-navigation react-navigation-stack