Another Landscape thread.
Hi everyone,
I have read a bunch of threads on how to make my application landscape, but I'm having a small, but major problem.
What my requirement is to have a window in Landscape mode, that shows an image as its back ground, with an edit control where the user can type a word or two and press a button to submit the information. I don't even know if that is possible?
Since I can't activate the edit control, I don't even know if the keyboard shows up correctly when the application is in landscape mode!
Here are the steps so far:
1. I created an application using the Window-Based Application wizard.
2. I placed an edit control on the window.
3. Then I put an entry in my info.plist for UIInterfaceOrientation = UIInterfaceOrientationLandscapeRight. This caused the application to put the status bar along the right edge of the iphone, but the window was still in portrait mode.
4. I added these lines to the applicationDidFinishLaunching method to rotate the window:
window.transform = CGAffineTransformMakeRotation(M_PI/2);
window.center = window.center; //no sure what this is really going to do!
At this point the window was rotated but I couldn't see my edit control, as the window was still (0,0,320,480). There were two black area on either side of the window. Seemed like it didn't resize the window to fit the landscape mode.
5. So I added this line before the two above.
window.bounds = CGRectMake(0,0,480,320);
At this point the window is displayed correctly. But I can't interact with the edit control on the window, when I click on it to fill it in nothing happens!
Thanks
Last edited by AcePilot; 09-12-2008 at 04:18 PM.
|