Time for action – controlling the position of the camera roll
Use the following steps to change the position of the default camera roll dialog box on an iPad:
Go to the
merges/ios/js
folder of the PhoneGap project you previously created, open theindex.js
file, and add a new function namedinitAdditionalOptions
:initAdditionalOptions: function(){ // Additional options will be defined here }
In the body of the
initAdditionalOptions
function, specify the device photo album as the source of thegetCamera
method as well as the size and position of the popover dialog box:app.cameraOptions.sourceType = Camera.PictureSourceType.SAVEDPHOTOALBUM; app.cameraOptions.popoverOptions = new CameraPopoverOptions(220, 600, 320, 480, Camera.PopoverArrowDirection.ARROW_DOWN);
Add a call to the
initAdditionalOptions
function at the end of thedeviceready
event handler:deviceready: function() { // All the events handling initializations are here app.initAdditionalOptions(); }
Open the command-line...