Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to create Menu with onPress attribute of TouchableOpacity

$
0
0

I want a profile picture uploading with the options: get image from camera (call getMediaFromCamera) on press or get image from gallery (getMediaFromImageLibrary)I have a TouchableOpacity but I want to create a menu when clicking so that the user can select the method. Do I need a menu or can this be done inside touchableopacity

<View style={imageUploaderStyles.uploadBtnContainer}><TouchableOpacity      onPress={getMediaFromCamera}      style={imageUploaderStyles.uploadBtn}><Text>        {props.profile_photo          ? Language.PersonalInformation.change_photo          : Language.PersonalInformation.add_photo}{''}</Text></TouchableOpacity></View>

I want something like below to popup when the user presses.

enter image description here


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>