react-native-popup-menu
react-native-popup-menu copied to clipboard
set the anchor of size to 0 and the margin to 0
hi, How can I set the anchor of size to 0 and the margin to 0?
<Menu
renderer={Popover}
rendererProps={{anchorStyle: styles.anchorStyle,placement:'top' }}
>
<MenuTrigger>
<View style={{backgroundColor:'green',height:40,width:screen.width,justifyContent:'center'}}>
<Text style={{textAlign:'center'}}>select</Text>
</View>
</MenuTrigger>
<MenuOptions customStyles={optionsStyles}>
<MenuOption customStyles={optionStylesTop}>
<Text style={{marginLeft:5,color: 'black',textAlign:'center'}}>item</Text>
</MenuOption>
</MenuOptions>
</Menu>
Hi you can set width, height or hide anchor via anchorStyle
property, e.g.:
rendererProps={{anchorStyle: {opacity: 0}, placement:'top'}}
Currently it is not possible to get rid of the margin because popover assumes that there is an anchor.
@xpbtmusic you can always use custom renderer - based on popover one. or maybe you can add new property (e.g. anchorSize
) to popover renderer and we can merge it to the lib.