我正在使用react native创建一个 iOS
和 Android
应用程序 .
我使用react-native-drawer作为我的导航抽屉 . 这在 iOS
和 Android
都可以正常工作 .
我试图在导航抽屉中获取一个视图寻呼机,以便我可以在导航抽屉中向左/向右滑动,类似于Slack移动应用程序 .
这是我的实施 .
Main.js
constructor(props, context) {
super(props, context);
this.state = {
drawerType: 'overlay',
openDrawerOffset: .15,
closedDrawerOffset:0,
panOpenMask: .4,
panCloseMask: .4,
relativeDrag: false,
tweenEasing: 'linear',
disabled: false,
tweenHandlerPreset: null,
acceptDoubleTap: false,
acceptTap: false,
acceptPan: true,
tapToClose: false,
negotiatePan: false,
rightSide: false,
};
}
...
<Drawer
ref={c => this.drawer = c}
type={this.state.drawerType}
animation={this.state.animation}
openDrawerOffset={this.state.openDrawerOffset}
closedDrawerOffset={this.state.closedDrawerOffset}
panOpenMask={this.state.panOpenMask}
panCloseMask={this.state.panCloseMask}
relativeDrag={this.state.relativeDrag}
panThreshold={this.state.panThreshold}
content={ <NavigationDrawer/> }
disabled={this.state.disabled}
tweenDuration={this.state.tweenDuration}
tweenEasing={this.state.tweenEasing}
acceptDoubleTap={this.state.acceptDoubleTap}
acceptTap={this.state.acceptTap}
acceptPan={this.state.acceptPan}
tapToClose={this.state.tapToClose}
negotiatePan={this.state.negotiatePan}
changeVal={this.state.changeVal}
side={this.state.rightSide ? 'right' : 'left'}
>
<MainContainer/>
</Drawer>
NavigationDrawer.js
render() {
let {height, width} = Dimensions.get('window');
return (
<View style={styles.controlPanel}>
<IndicatorViewPager style={ {height: height} } removeClippedSubviews={false} indicator={this._renderDotIndicator()}>
<View style = {{backgroundColor : 'green'}}></View>
<View style = {{backgroundColor : 'red'}}></View>
</IndicatorViewPager>
</View>
);
}
在Android应用中,它按预期工作 . 但在iOS应用程序中,导航抽屉默认情况下始终处于打开状态 .
我在这里想念的是什么?