Book Image

PhoneGap Beginners Guide (third edition)

Book Image

PhoneGap Beginners Guide (third edition)

Overview of this book

Table of Contents (22 chapters)
PhoneGap Beginner's Guide Third Edition
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Related Plugin Resources
Index

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:

  1. Go to the merges/ios/js folder of the PhoneGap project you previously created, open the index.js file, and add a new function named initAdditionalOptions:

    initAdditionalOptions: function(){
    
        // Additional options will be defined here
    
    }
  2. In the body of the initAdditionalOptions function, specify the device photo album as the source of the getCamera 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);
  3. Add a call to the initAdditionalOptions function at the end of the deviceready event handler:

    deviceready: function() {
        // All the events handling initializations are here
        app.initAdditionalOptions();
    
    }
  4. Open the command-line...