React native 反应本机抽屉在iOS中始终打开
我正在使用创建一个React native 反应本机抽屉在iOS中始终打开,react-native,navigation-drawer,react-native-ios,React Native,Navigation Drawer,React Native Ios,我正在使用创建一个iOS和Android应用程序 我用过我的导航抽屉。这在iOS和Android中都能正常工作 我正在尝试在导航抽屉中获取一个查看寻呼机,以便我可以在导航抽屉中向左/向右滑动,类似于移动应用程序 这是我的实现 Main.js constructor(props, context) { super(props, context); this.state = { drawerType: 'overlay', openDrawerOffset:
iOS
和Android
应用程序
我用过我的导航抽屉。这在iOS
和Android
中都能正常工作
我正在尝试在导航抽屉中获取一个查看寻呼机,以便我可以在导航抽屉中向左/向右滑动,类似于移动应用程序
这是我的实现
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>
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>
);
}
构造函数(道具、上下文){
超级(道具、背景);
此.state={
抽屉类型:'覆盖',
OpenDrawerofset:.15,
CloseDddraWebSet:0,
全景遮罩:.4,
panCloseMask:.4,
relativeDrag:false,
tweenEasing:'线性',
残疾人士:错,,
tweenHandlerPreset:null,
接受双击:错误,
acceptTap:错,
潘:是的,
tapToClose:false,
谈判潘:错,
右边:错,
};
}
...
this.drawer=c}
类型={this.state.drawerType}
动画={this.state.animation}
opendrawerofset={this.state.opendrawerofset}
closeddrawrofset={this.state.closeddrawrofset}
panOpenMask={this.state.panOpenMask}
panCloseMask={this.state.panCloseMask}
relativeDrag={this.state.relativeDrag}
panThreshold={this.state.panThreshold}
内容={}
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'}
>
NavigationDrawer.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>
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>
);
}
render(){
设{height,width}=Dimensions.get('window');
返回(
);
}
在Android应用程序中,它的工作原理与预期一致。但在iOS应用程序中,默认情况下导航抽屉始终处于打开状态
我遗漏了什么?您找到解决方案了吗?