d-a-n / react-native-modal-picker

A cross-platform (iOS / Android), selector/picker component for React Native that is highly customizable and supports sections.
MIT License
410 stars 373 forks source link

Height optionContainer #27

Open anarwade opened 7 years ago

anarwade commented 7 years ago

Hi,

At the moment, there is no way to adjust the height of the optionContainer. Could you please add another property so we can change it? On some mobile phones this height (const OPTION_CONTAINER_HEIGHT = 400;) is too large and the cancel button shows outside the screen. Thank you

Greetings,

A. Narwade

atennapel commented 7 years ago

In my fork I simply added a way to style the optionContainer and cancelContainer: https://github.com/atennapel/react-native-modal-picker/commit/d88050fa1a80727050a9a5e36f2ccb4adba13647

yaakua commented 7 years ago

I need this too ,TKS!

peacechen commented 7 years ago

I recommend removing the static _OPTION_CONTAINERHEIGHT and instead use flex. This would allow optionContainer to automatically stretch (or shrink) to its contents, limited by the device size of course.

I've submitted PR #37. In combination with PR #33, this gives users out of the box support for all screen sizes while allowing users the flexibility to customize to their hearts content.