UIImagePickerController camera view overlay based on rotation - iphone

I want to notify users to take photos only in landscape mode.
I got idea to put some overlay on camera view and if iPhone is in portrait mode to put some label with text "Use landscape mode instead of portrait".
Is it posible? Do you have some advice how to make this posible?

You can have Text (label) on your overlay form (with the note). In the UIImagePickerController delegate check for orientation using , UIInterfaceOrientationIsLandscape and unhide (hide) the text.
I prefer displaying the text through out (irrespective of orientation) to the user for better user experience.

Related

Customization of UIImagePickerController

I am working on camera application in which I want to set the screen of the camera i.e camera window appear for particular frame. And in front of camera screen the cut out image is coming so that user can see the background through the cut out part of the image and capture the image. So any one know to do this i.e. customization of UIImagePickerController.
UIImagePickerController has a property named cameraOverlayView. Use this to set your camera overlay as any view you like. Use normal view transparency for letting the user see parts of the live camera view.

different theme for landscape and portrait mode

Let me explain what I am creating and it will be nice if someone could tell me a better approach.
I am creating an app that supports all orientations. The app is like a power point presentation with several slides with several images and basic functionality in each slide. the functionality is very simple such as showing an image or moving an image when a button is pressed for example. So creating the app is not the problem. Since this app has to support all orientations when the device enters portrait mode I need to move the content in order to make it fit for the portrait orientation. And I would have to do the same thing if it enters landscape mode. Because there is so much content in every slide I need to change the content very much when changing orientation. so an image in portrait mode might have cords (20,5) and on landscape mode that image will have totally different coordinates.
So is there a way that I can set the IBOutlets have specific cords on landscape and specific cords on portrait with xcode. It takes me forever to store the cords of every IBOutlet in an array since I have so many IBOutles in each slide. I have to store the CGPoints in an array with the cords of IBOutlets in landscape and portrait mode and then if the device enters landsape mode set it's center equal to the array elemets. THIS IS SIMPLE BUT IT TAKES FOREVER!
Moreover I am creating many xib files and treat each xib as a different slide in my app.
With what you are saying, you need two xibs for each "slide". One that describes the portrait orientation, and one that describes the landscape orientation.

Display launch image in Landscape Mode?

I am using Cocos2d and Xcode 4. My app currently displays the launch image in portrait mode, then switches to landscape so the image is on its side, then launches the app. How can I:
1. Make it run the launch image for a certain duration.
2. Make it display it in Landscape mode, not portrait.
Any Help is appreciated. Thanks!
Can't you just make your image in landscape and use that? Basically like what zeiteisen said.
Just open up gimp or photoshop and make a new image: 480w X 320h.
To make your launch image display in landscape mode, simply append -Landscape to its filename (e.g. change LaunchImage.png to LaunchImage-Landscape.png).
As for showing your launch image for a certain duration, you have two options: display a "launch image" view controller initially and dismiss it after the desired duration (allows you to fade the image out, etc.), or simply call sleep() in your app delegate's application:didFinishLaunchingWithOptions:. It's important to note that you have no control over how long the OS displays your launch image before control is passed to your app delegate—you need to take this into consideration.
Just rotate the Default.png in your favourite image editor like Photoshop.
I had a similar problem and fixed it by changing the view to landscape in Interface Builder. Mine is still animating though from the initial portrait orientation of the Window (not settable to landscape in IB).
In AppDelegate applicatio:didFinishLaunchingWithOptions there is a call to
[director_ pushScene: [IntroLayer scene]]. In there, it shamelessly loads the splash screen again and displays it rotated by 90 degrees:
if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ) {
background = [CCSprite spriteWithFile:#"Default.png"];
background.rotation = 90;
}
Removing this fixes the rotating splash screen problem.

Photo Picker app has same issue!

This is related to my previous thread, but opened a new one here as it involves Apple's own sample code.
Open the sample code and modify the app so it will display in landscape and add a textfield to the view.
Run the app and open the image picker, select an image and you will be returned to the previous screen in landscape as you would expect.
Now tap the text field and see the keyboard scroll into view....in portrait mode?
This happens on the iPad not the iPhone, what gives????
link text
I have found the answer on this forum :-)
"The keyboard will show up in the orientation of the statusbar, which doesn't always change with rotations for some reason. So if you want to display that view only in landscape set [UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft; or whichever orientation you want to prefer in your viewWillAppear method."
Although why it does not do this on the iPhone ????

Drawing UI components when device orientation changes

When I open any form in my app in Portrait mode and tap on any textfield (keyboard pops up) and then change the device orientation to landscape, page is no longer scrollable to bottom most UI widgets. But if you open the same page directly in Landscape mode, it works fine
I think idea should be like:
1. Capture the change in device orientation
2. Change the frames of UI components as required
3. Redraw the screen
Please suggest.
You simply set adjust your frame for landscape mode.. U did not allocate memory just adjust frame only...