我正在使用react native进行跨平台应用程序,其中包含使用router-flux描述的路由和场景,并且是多页面的。我正在尝试为IPhoneX实现SafeAreaView,但没有太多运气。到目前为止,我添加了SafeAreaView标记作为特定视图的高级组件,但是为每个平台移动主视图(而不仅仅是IphoneX)如何添加该检查以仅显示IPhoneX的行为以及我如何把它添加到我的场景中?
Router.js
import { Actions, ActionConst, Router, Scene } from 'react-native-router-flux';
const RouterComponent = () => {
return (
<Router
barButtonIconStyle={{ tintColor: '#7E8DA5' }}
navigationBarStyle={{ backgroundColor: '#F5F8FA', borderBottomWidth: 0 }}
// {...this.props}
>
<Scene component={NavigationDrawer} key="main" type={ActionConst.RESET}>
<Scene
navigationBarTitleImage={require('../../img/Logo.png')}
navigationBarTitleImageStyle={styles.navBarImage}
navigationBarStyle={styles.navBar}
component={Home}
key="home"
/>
//more scenes described here
</Scene>
</Router>
);
};
Home.js //在render方法中有视图