React Native: How to create a menu brought up from bottom?

javascript reactjs react-native redux

1877 просмотра

2 ответа

1382 Репутация автора

I am trying to recreate the following, where a menu is brought up from bottom when a button is pressed, but lost as to where to start. How can I go about doing so?

Any guidance or insight would be greatly appreciated.

Автор: Jo Ko Источник Размещён: 22.08.2016 09:26

Ответы (2)

1 плюс

775 Репутация автора

You can use a module like this for an example. IMO this can be done in two ways:

  1. Slide a View with animation like in the library linked above.

  2. Use a Modal component that will slide from the bottom (it's actually a default behaviour of this component). Remember to add a margin on top of the content to don't slide it to the top of the screen).

Автор: Radek Czemerys Размещён: 22.08.2016 09:48

0 плюса

5012 Репутация автора

It looks like this is the best so far. Works on Android and iOS.

Note: it requires native modules so it won't work on Expo.

Alternatively, you use this component from NativeBase:

FYI: I haven't tested react-native-bottom-action-sheet

Автор: Gianfranco P. Размещён: 22.11.2018 02:45
Вопросы из категории :