我在我的应用程序中使用抽屉,我的问题是我想在抽屉场景中使用自定义图标,它可以,但我没有看到任何文档告诉我如何打开或关闭抽屉!
这是我的路由器:
<Scene
key="TabbarWrapper"
component={NavigationDrawer}
initial={true} >
<Scene key="Tabbar"
tabs={true}
initial={true}
tabBarStyle={styles.tabBar}
default="ProductExplorer">
<Scene key="ProductExplorer"
title="Lists"
icon={TabIcon}
iconName={"list"}
initial={true}
leftButtonIconStyle={{tintColor: "#FFF"}}
renderBackButton={backButtonFunction}
component={ProductExplorer}/>
<Scene key="Profile"
title="Profile"
icon={TabIcon}
iconName={"gear"}
leftButtonIconStyle={{tintColor: "#FFF"}}
renderBackButton={backButtonFunction}
component={Profile}/>
</Scene>
</Scene>
这是我的按钮渲染器功能:
let backButtonFunction = function () {
var TouchableElement = TouchableHighlight;
if (Platform.OS === 'android')TouchableElement = TouchableNativeFeedback;
return (
<TouchableElement onPress={()=>{
**** my problem is here **** what do you think i should do?!what function must be call here to toggle open and close menu?
}} style={{position : "absolute",left: 12,bottom:12}}>
<Icon style={{color: "#FFF"}} name={"bars"} size={23}/>
</TouchableElement>
);
};