问题标签 [react-native-drawer]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
693 浏览

react-native - react-native: How to combine react-native-router-flux and react-native-drawer?

I'm trying to integrate react-native-router-flux with react-native-drawer

My main component is actually App.js . I copy/paste only relevant pieces.

This is Router.js

My goal is to add the SideDrawer into the Scene bucket with key "mainBucket"., because, as you can see, this is/will be the main portion of my app, and user is automatically redirect to this bucket implementing autologin using firebase.

The autologin and the opening of the mainBucket works.

To start working with adding sidedrawer, I think the sidedrawer content componente initially will render just a <Text> usingn SideMenu component

How must I procede?

I created the following two files.

The first is NavigationDrawer.js

And the second is a near-empty SideMenu.js

I tried then to modify scenes definitions adding into mainBucket definition the NavigationDrawer component

The problem is that I cannot see no more the react-native-router-flux headers with the title, so I've no more by top action bar.

What am I doing wrong'?

0 投票
1 回答
1587 浏览

reactjs - 反应导航抽屉位置

我正在使用来自https://reactnavigation.org/docs/navigators/drawer的 React Navigation 的抽屉,我想在标题下方给出抽屉的起始位置,但我不知道如何实现这一点。我一直在查看 reactnavigation.org 的文档,但找不到任何提示。

0 投票
5 回答
1557 浏览

react-native - _this._drawer.open 不是一个函数 react-native

我正在为我的反应原生应用程序使用原生基础的抽屉。当您单击菜单按钮时,抽屉未打开并且我收到此错误(_this._drawer.open)不是功能什么是我的代码

这是我的 SideBar.js

附言。此抽屉与 npm 'react-native-drawer' 中的相同

0 投票
1 回答
2039 浏览

android - 使用 React Native Router Flux 设置的 React Native Drawer 无法正常工作

我正在尝试使用 react-native-router-flux 设置 react-native-drawer。

我已经按照下面的flux OTHER INFO doc设置了抽屉

然后我将抽屉场景放在路由器组件中,如下所示

现在的问题是,从另一个组件,例如 ServiceChoice,如果我这样做Actions.map(),什么也不会发生。

谁能指出我做错了什么?我可以提供任何其他需要的信息。所有导入也是正确的。

谢谢

0 投票
1 回答
763 浏览

react-native - react-native-router-flux 如何使用 react-native-drawer 打开场景?

我尝试在我的应用程序中使用react-native-drawer ( https://github.com/root-two/react-native-drawer ) 和react-native-router-flux

根据文档,我已将带抽屉的场景添加到路由器:

在我的 LoginScene 中,我调用:

按下登录按钮后,但没有任何反应。

有任何想法吗?提前致谢。

0 投票
1 回答
705 浏览

reactjs - 使用 ref prop 时 undefined 不是对象(评估 _this2_.drawer.open)

我一直在尝试按照这些文档的建议使用 ref 道具让 react-native-drawer 工作,但我收到以下错误:undefined is not an object (evaluating _this2_.drawer.open)我已经梳理了堆栈溢出的类似问题,并且很难将此错误文本连接到任何一个问题,为什么会这样?

0 投票
1 回答
653 浏览

javascript - react-native 上的动画子菜单

我正在使用 native-base 库创建一个 react-native 应用程序,并且我正在使用 native-base list 组件作为侧边菜单,但我有一个问题,我不知道如何在我的侧边菜单中制作子菜单,我需要能够在单击菜单项时打开带有动画的子菜单。

列表编码如下:

但是我想向它添加一个子菜单,例如,如果我单击菜单 1,则子菜单带有 sub1 sub2 淡入。这是我想要的结果视频中的一个示例: http ://res.cloudinary.com/atf19/视频/上传/v1500308199/AwesomeScreenshot-2017-07-17T16-14-52-723Z_wymybj.webm

我尝试在我的实际列表中使用另一个列表,但它只是弄乱了设计,我寻找管理此类问题的反应原生插件,但我没有找到任何问题。

PS:请注意,列表项是从服务器动态创建的。

0 投票
1 回答
103 浏览

react-native - 页面上有 2 个抽屉导航器

我创建了两个基本的 DrawerNavigator。一个用于左侧,另一个用于顶栏的右侧:

是否可以在 MainScreen 视图中使用两个抽屉?谢谢!

0 投票
1 回答
1880 浏览

react-native - 如何使用 ToolbarAndroid 实现 React 原生 DrawerLayout?

我正在尝试通过单击工具栏中的菜单图标来实现导航抽屉,我已经尝试了很多天,但我在网上找不到任何好的资源,我遵循了一些堆栈溢出答案并实现了这个:

我的工具栏.js

openDrawerFromToolbar.js

index.android.js

最初单击工具栏没有执行任何操作,并且导航抽屉没有打开,现在我得到了空白屏幕。我在代码中缺少什么?

编辑:我已经更新了代码,现在我面临这个错误:“元素类型无效:需要一个字符串(对于内置组件)或一个类/函数(对于复合组件)但得到:对象。

我已经检查了其他此类问题,他们说某些导入或导出是错误的,我无法找出在我的情况下哪个是错误的,有人可以帮忙吗?

0 投票
1 回答
467 浏览

ios - 如何使用 react-native-router-flux 在 react-native-drawer 内进行导航

我已经使用react-native-drawer. 抽屉视图包含ListView. 每当单击该renderRow方法时,都需要在抽屉本身而不是Welcome屏幕堆栈顶部显示导航。

现在:在此处查看屏幕截图

预期: 想要实现这样的目标 - 多级菜单

文件:组件/welcome.js

文件:组件/setting.js

Welcome它在屏幕顶部导航。我需要在抽屉本身上导航。我怎么能做到这一点?