58203

iPhone UIImagePicker Camera in Landscape Orientation

Is there any good way to set UIImagePicker to landscape orientation? I tried to call setStatusBarOrientation after presentModalViewController like following,

[self presentModalViewController:picker animated:YES]; [[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO ];

However, the video duration view (00:00) on the right corner didn't rotate as orientation changed.

Answer1:

Unfortunately, according to the documentation, the image picker only supports portrait mode.

Answer2:

Apple doesn't support landscape for camera view. If you want anything shown as customised then add overlay view on it & transform that view to look as landscape view. @Note:-overlay is also add as portrait thats why transformation needed.

Answer3:

I was able to create landscape camera view using the following code:

[self.view insertSubview:self.imagePicker.view atIndex:0]; self.imagePicker.view.transform = CGAffineTransformScale ( CGAffineTransformTranslate( CGAffineTransformMakeRotation(M_PI/2), -90, -15), 1.2,1.2) ;

Note that I am directly adding the imagePicker's view to the current view, not calling it as a modal.

self.imagePicker.view.transform seems to respond as expected to all CGAffineTransform function calls, though I can't speak to whether or not Apple approves of this method.

Recommend

  • In shared classes how to use local resources?
  • How do you make a custom error page?
  • Objective C - create NSDate from two Strings
  • Transposing a javascript array efficiently
  • React Native: Native Android UI component with JWPlayer shows no video image
  • How can I rotate a UIViewController to its supported interface orientation when navigating to it?
  • Can PyCharm set breakpoints on ipython notebook?
  • Resource for understanding view, projection, 'virtual camera' in OpenGL or graphics in gen
  • Associate ID with Class in CSS
  • Which way to go with graphic-intense multi-touch app, XNA or WPF?
  • Unable to scan Code 128
  • .net security exception
  • formediting modals shows at wrong position
  • Does SmartGit support git-svn?
  • segue from landscape only to portrait only
  • Phonegap GA plugin not working
  • custom string delimiters stringtemplate-4
  • Galaxy S4 Android Custom Camera Issue
  • SIP API media codecs
  • How to create two column output from a single column
  • How can I get the choice “H2” back in the H2 consol?
  • Approximate Order-Preserving Huffman Code
  • How can I enlarge video fullscreen without the affected interface project in as3?
  • Python urlparse: small issue
  • FileReader+canvas image loading problem
  • Spring Data JPA custom method causing PropertyReferenceException
  • Why ng-show works with ng-repeat but ng-if doesn't? [duplicate]
  • Resize panoramic image to fixed size
  • Excel - Autoshape get it's name from cell (value)
  • Java applet as stand-alone Windows application?
  • How to apply VCL Styles to DLL-based forms in Inno Setup?
  • Jquery - Jquery Wysiwyg return html as a string
  • Cannot Parse HTML Data Using Android / JSOUP
  • SQL merge duplicate rows and join values that are different
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How get height of the a view with gone visibility and height defined as wrap_content in xml?
  • Getting Messege Twice Using IMvxMessenger
  • python draw pie shapes with colour filled
  • Reading document lines to the user (python)
  • How to load view controller without button in storyboard?