Android 本机基的抽屉不工作 import React,{Component}来自“React”; 从“本机基础”导入{抽屉、容器、标题、左侧、按钮、图标}; 进口{ 评估学, 文本, 看法 触控高光, 形象,, 可触摸且无反馈, 领航员, 后手 }从“反应本族语”; //var PayPal=require('react-native-PayPal'); 从“/Styles/profileStyle”导入profileStyle; 从“/images”导入图像; 从“/ori_仪表板”导入OriDash; 导出默认类菜单扩展组件{ 建造师(道具){ 超级(道具); 此.state={ modalVisible:false }; this.closeDrawer=this.closeDrawer.bind(this); this.openDrawer=this.openDrawer.bind(this); } closeDrawer=()=>{ 此._drawer._root.close(); }; openDrawer=()=>{ //警报(“此处”); 这个._drawer._root.open(); }; render(){ 返回( { 这个.\u抽屉=ref; }} 内容={} onClose={()=>this.closeDrawer()} > { 这个.openDrawer(); }} > ); } }
一旦抽屉标签被移除,容器就会变得可见,否则容器内容也不会显示。有人能帮助我使用抽屉组件,以及如何在单击它时打开菜单。我已经创建了一个组件OriDash,其中会显示菜单内容,单击ios主图标,菜单应分别打开和关闭。我将容器部分的所有内容复制到了我的测试应用程序中,在测试应用程序中,我使用的是提供者父级而不是视图,我自己的组件用于抽屉的内容。页面显示时,页眉有一个主图标,抽屉工作,我可以从屏幕左边缘滑动打开它。页眉中的主页按钮也会打开抽屉。我想知道你的观点是否应该来自本地而不是本地?Android 本机基的抽屉不工作 import React,{Component}来自“React”; 从“本机基础”导入{抽屉、容器、标题、左侧、按钮、图标}; 进口{ 评估学, 文本, 看法 触控高光, 形象,, 可触摸且无反馈, 领航员, 后手 }从“反应本族语”; //var PayPal=require('react-native-PayPal'); 从“/Styles/profileStyle”导入profileStyle; 从“/images”导入图像; 从“/ori_仪表板”导入OriDash; 导出默认类菜单扩展组件{ 建造师(道具){ 超级(道具); 此.state={ modalVisible:false }; this.closeDrawer=this.closeDrawer.bind(this); this.openDrawer=this.openDrawer.bind(this); } closeDrawer=()=>{ 此._drawer._root.close(); }; openDrawer=()=>{ //警报(“此处”); 这个._drawer._root.open(); }; render(){ 返回( { 这个.\u抽屉=ref; }} 内容={} onClose={()=>this.closeDrawer()} > { 这个.openDrawer(); }} > ); } },android,react-native,drawer,native-base,Android,React Native,Drawer,Native Base,一旦抽屉标签被移除,容器就会变得可见,否则容器内容也不会显示。有人能帮助我使用抽屉组件,以及如何在单击它时打开菜单。我已经创建了一个组件OriDash,其中会显示菜单内容,单击ios主图标,菜单应分别打开和关闭。我将容器部分的所有内容复制到了我的测试应用程序中,在测试应用程序中,我使用的是提供者父级而不是视图,我自己的组件用于抽屉的内容。页面显示时,页眉有一个主图标,抽屉工作,我可以从屏幕左边缘滑动打开它。页眉中的主页按钮也会打开抽屉。我想知道你的观点是否应该来自本地而不是本地? import
import React, { Component } from "react";
import { Drawer, Container, Header, Left, Button, Icon } from "native-base";
import {
AppRegistry,
Text,
View,
TouchableHighlight,
Image,
TouchableWithoutFeedback,
Navigator,
BackHandler
} from "react-native";
// var PayPal = require('react-native-paypal');
import profileStyle from "./Styles/profileStyle";
import images from "./images";
import OriDash from "./ori_dashboard";
export default class Menu extends Component {
constructor(props) {
super(props);
this.state = {
modalVisible: false
};
this.closeDrawer = this.closeDrawer.bind(this);
this.openDrawer = this.openDrawer.bind(this);
}
closeDrawer = () => {
this._drawer._root.close();
};
openDrawer = () => {
// alert("here");
this._drawer._root.open();
};
render() {
return (
<View>
<Drawer
ref={ref => {
this._drawer = ref;
}}
content={<OriDash navigator={this._navigator} />}
onClose={() => this.closeDrawer()}
>
<Container>
<Header>
<Left>
<Button
transparent
onPress={() => {
this.openDrawer();
}}
>
<Icon
name={"ios-home"}
style={{ fontSize: 20, color: "#00c497" }}
/>
</Button>
</Left>
</Header>
</Container>
</Drawer>
</View>
);
}
}