views:

297

answers:

1

I need to take keyboard input in my OpenGL ES application, so I just created a hidden UITextField and added it as a subview to the main window along with the view that presents my content. I use the UITextField to control the keyboard and it works fine in a single orientation.

I then changed my code to support all orientations by rotating the OpenGL content myself based on UIDeviceOrientation notifications. To rotate the keyboard, I overrode the shouldAutoRotateInterfaceOrientation method in the UITextField's controller and returned YES for all orientations. But I still see that the keyboard does not rotate according to the orientation.

Any clues?

Update: I solved this issue by adding the UITextField to a second hidden window and adding that window to my main window as a sub view. Not sure if this is acceptable, but it seems to solves my problem. But I still don't think that is the answer, so I'm leaving this question unanswered.

Update: Since iOS 4.0 adding the hidden window as a subview to the keyWindow seems to break things. The application crashes if you send it to background, then foreground, then background and in the end foreground. So, just leave the hidden window hanging, it should still work.

A: 

ME to having this problem plz help me!!!!