Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to switch the live screen camera icons from portrait to landscape mode in iPhone?
    primarykey
    data
    text
    <p>I created a <strong>custom camera overlay</strong> for the live screen camera view and have imported my own custom icons for the camera, flash and flip buttons. Everything looks good in portrait mode, but when I switch the live camera screen to landscape mode, the orientation of the camera stays in portrait mode and shows this in console,</p> <p><strong>"Error: CGAffineTransformInvert: singular matrix"</strong></p> <p>I tried using the <strong>auto resizing mask</strong>, also have tried setting two different frames for the icons in both portrait and landscape mode in <strong>didRotateFromInterfaceOrientation</strong> method. But none of these are working. </p> <p>My question is, will the landscape orientation support only the default iPhone camera overlay view or will it also support the custom overlayview.</p> <p>Here are the screenshots indicating the behaviour of the icons repositioning each other when switched from portrait to landscape mode. I want exactly like this in my custom overlay view. </p> <p><strong>Edit:</strong></p> <p>I've made the live screen of my custom camera overlay to change by using the <strong>UIDevice Orientation</strong> method. But right now, the frame is not resizing when i try to switch from the portrait to landscape mode. So, i just want the entire frame to resize in landscape mode. Also, in this piece of code, if i try to change the value of <strong>CAMERA_TRANSFORM_Y</strong>, </p> <pre><code>#define CAMERA_TRANSFORM_X 1 #define CAMERA_TRANSFORM_Y 1.234 self.picker.cameraViewTransform = CGAffineTransformScale(self.picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y); </code></pre> <p>the size of the overlay view reduces both from the top and bottom margin. But, more size gets reduced from the bottom than from the top margin. I want the overlay size to change uniformly both from the top and from the bottom margin.</p> <p>This is my sample code,</p> <p><a href="https://www.dropbox.com/s/eha3snfnrjamdzo/CustomCamera.zip" rel="nofollow noreferrer">Sample project</a></p> <p><img src="https://i.stack.imgur.com/chhqs.jpg" alt="Landscape mode"></p> <p><img src="https://i.stack.imgur.com/Bq9MM.jpg" alt="Potrait mode"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload