Phonegap - give user option of PictureSourceType

2020-02-15 03:11发布

问题:

just starting out with this:

My PhoneGap app at some point uploads images to a server through a form.

I can get the image from the CAMERA and I can get the image from the PHOTOLIBRARY.

Is there a way of specifying multiple sources for the sourceType: Camera.PictureSourceType or does it only take one at a time.

In other words...

Is there a way to give the user the option of selecting their photo source that is native to PhoneGap or do I need to create my own 2 buttons in which the user can select "Take Photo" or "Select Photo from Library"

I have no problems building the 2 button solution but i'd hate to build it if I didn't have to.

回答1:

As far as I know, there is not a way to accomplish what you are explaining. You can see in the Phonegap Doc that the possible options are the two you mentioned. I faced the same problem and ended up opening a dialog letting the user to choose the source of the picture.