【发布时间】:2017-12-16 03:06:47
【问题描述】:
我正在尝试为我的 React Native Expo 应用程序实现导航栏。这里有一个问题:
"dependencies": {
"expo": "^18.0.3",
"react": "16.0.0-alpha.12",
"react-native": "^0.45.1",
"react-navigation": "^1.0.0-beta.11"
}
我不知道在哪里以及如何设置此组件的样式以使其不与通知栏重叠。我试图为我的根视图设置marginTop: StatusBar.currentHeight,但它不起作用。它在视图上应用了边距,但不在导航栏上。
我的应用:
import {StackNavigator} from 'react-navigation';
import Home from './app/screens/Home';
export default App = StackNavigator({
Home: { screen: Home }
})
首页:
export default class Home extends Component {
constructor() {
super();
// <...>
}
static navigationOptions = {
title: 'Welcome'
};
// <...>
}
【问题讨论】:
标签: android reactjs react-native expo create-react-native-app