3

I have a menu with a anchor to a button.

I would like to style width of menu such as button.

I have try with style=width:100% but doesn't works. If I change the dimension in pixel, it change.

How I can style with flex mode (for dynamic width).

This is an example: https://snack.expo.io/@temuccio/menu

Francesco
  • 135
  • 2
  • 11

2 Answers2

1

Found a solution: use List.Item instead of Menu.Item

I tried solution mentioned in https://github.com/callstack/react-native-paper/issues/2314#issuecomment-716496115

but some how even if the width of Menu.Item becomes 100% ,some part of Menu.Item at right becomes not clickable
so only solution that worked for me was to replace Menu.Item with List.Item

This is an example:https://snack.expo.io/@gautami123/menu

0

If you are trying to use flex: 1 to style this, you should pass this as the style prop: style={{ flex: 1 }}.

  • 1
    I use this. If you view the example at 20th row there is `style={{flex:8}}`. I have try to change the number of flex but the width are fixed. – Francesco Oct 24 '20 at 05:57