Forcing keyboard and sub-view orientation on iOS (iPad / iPhone) - iphone

We are just putting user input into our game so the user can enter email address etc. The entire game is Gl with no iOS UI at all. The EAGLView does not change orientation, it is always in portrait, however the game is in landscape and we handle this with a camera transform.
We want to bring up the iOS keyboard and overlay a UITextView for the text input. The UITextView is a subview of the EAGLView. Obviously it, and the keyboard, shows up in portrait as the EAGLView is in portrait.
Without having to change the EAGLView to landscape is there any way I can force the UITextView and the keyboard to show up in landscape orientation?
If I do change the orientation of the EAGLView to landscape to get this working, is there any hit on performance? I have read several times that orienting a GL view in anything other than the default portrait view will give a performance hit, although I can't find any solid evidence of this.
Thanks,

We think we have come up with a solution for this. We are doing two things, one for the keyboard and the other for the UITextView.
For the keyboard we are setting the status bar orientation. The keyboard follows when set.
[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeRight;
And to get the UITextView to orient correctly we apply a transform to subviews of our EAGLView, which in this case is only the UITextView, as follows.
CGAffineTransform aTransform = CGAffineTransformMakeRotation(M_PI / 2);
[glView UpdateSubViewTransforms:aTransform];
This literally adds a 90 degree rotation to the view.
This has been tested on iPad & iPhone 4 with iOS 4.3, and on iPhone 3G with iOS 3.13.

Related

UIView rotation doesn't work properly in Swift

My UIViewshould always be in fullscreen but that doesn't really work sometimes. Every time the user rotates the device, the method viewWillLayoutSubviews gets called.
Here I print the height and width of the UIView.
The height and width of the UIView are right (1024 width,768 height in landscape mode).
Anyway, on the iPad the View hasn't this size altough I write it to the Console.
In portrait mode everything works, but in landscape not so what could be the problem?
If the iPad is in landscape mode and I start the app it works but if I rotate it (then it's portrait) and rotate it back to landscape, the view isn't in fullscreen anymore.
Simply pin the edges of your UIView to the edges of the view controller's main view with constant of 0, once when you add the UIView to the interface, and all will be well thereafter.

How to handle UIImagePickerController overlay rotation in landscape?

You cannot subclass UIImagePickerController, but surely there is clean(not saying obvious or easy) way to keep camera feed as background of UIViewController and just make UIImagePickerController overlay to rotate like it would respond to shouldAutorotateToInterfaceOrientation: ?
I just want to UIImagePicker stay in its beloved portrait orientation, but I want rotate my UI buttons that I put into camera overlay. What I have now, is changing each element's orientation with CGAffineTransformMakeRotation() so it always stays at the same place, but rotates around each center.
I downloaded Layar app and the somehow achieved it... camera feed stays and UI buttons rotates (like UIViewController's style).
edit: I have to use iOS 5.1 and Xcode 4.2
edit2: for now I have this int DIRECTION and depending on what is the current orientation of the device I assign from 0 to 3, so I can decide with what angle to rotate all UI buttons. I do this inside shouldAutorotateToInterfaceOrientation: which is returning only YES for portrait and upside portrait.
You have to put constraints on the buttons and picker view.
Use this link to study AutoLayout concept by Ray Wenderlich
Hope this will help but you have to go through it thoroughly.

UIImagePickerController differences from iPhone and iPad woes

I have an app designed for iPhone that makes use of the UIImagePickerController.
The app run in landscape only up until the image picker comes into view in its default portrait.
Problem 1:
On the iPhone when I rotate the device to portrait to view the image library the image picker view seems to do a flip as if rotating from landscape to portrait?
Problem 2:
I get the dreaded warning Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
Problem 3.
on the iPad when selecting an image the image picker is dismissed and the view is back in landscape but ...... if I then do anything that requires alert view or the keyboard they appear as if the device is in portrait? This does not happen on the iPhone???
I know problem 2 is a long running issue but please can anyone help with problems 1 & 3?
Thanks
number 3 resolved :-)
"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."

iphone - programmatically rotate system keyboard to landscape when device is in portrait orientation

I would like to do this because the keyboard buttons are slightly bigger in landscape mode than portrait and I will have older users using my app.
Does anybody know a way to do it??
Thanks.
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.

Portrait Orientation is losing touch input

I'm making a universal apps with auto rotation, and I'm only using landscape left and right. When I rotate the iPhone to the portrait down position, I can see what looks like a window underneath the app rotating and I no longer get touch events.
In all the shouldAutoRotate functions I'm making sure only return true for landscape, and the info.plist only allows landscape left and right.
Sounds like your view is not correctly resizing after an orientation change. Easy way to check this is to set the background color to something non-white.