Forcing Landscape orientation for TabBarController and NavigationController

Hello,
I'm writing an application that need to force LandscapeRight with a UITabBarController that contains a UINavigationController that contains UIViewController.
I can force UIViewController to landscape, but when I add the UINavigationController, the emulator starts as Landscape, but returns to Portrait when I call [window addSubView:], and the viewOrientation field from window switch from 0 to Portrait.
Is there anybody has worked with landscape orientation ? (it's really hard to make a landscape app, indeed).
David

The code below almost works. It does force landscape orientation. The problem I am having is that the navigation items in the navigation bar are not centering themselves until the device is physically rotated. Hope it helps.
Ed
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
// get height of status bar before setting the status bar to landscape orientation
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
// set the status bar to landscape orientation
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
// rotate
UIScreen *screen = [UIScreen mainScreen];
CGRect newBounds = CGRectMake(0, 0, screen.bounds.size.height, screen.bounds.size.width - statusBarFrame.size.height);
self.navigationController.view.bounds = newBounds;
self.navigationController.view.center = CGPointMake(newBounds.size.height / 2.0, newBounds.size.width / 2.0);
self.navigationController.view.transform = CGAffineTransformConcat(self.navigationController.view.transform, CGAffineTransformMakeRotation(degreesToRadian(90)));
self.navigationController.view.center = window.center;
here is the function definition
#define degreesToRadian(x) (M_PI * x / 180.0)

Similar Messages

  • Force Landscape Orientation?

    Does anybody know of a way to force landscape orientation for a view controller in an iPhone application?
    I have defined a UI in Interface Builder that I want to always show in landscape mode.
    When the app first starts though, it is always in Portrait Mode.
    Once the orientation is changed to landscape it will never go back to Portrait since I have setup the shouldAutorotateToInterfaceOrientation method correctly, but I can't seem to figure out a way to start it out in landscape mode.

    Andrew, I'm having a very similar problem. Have you found a solution yet?
    I have an app that has two screens, one is displayed landscape, and the other is displayed portrait. The user can press a button to swap between them. When I switch between the views I call
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait];
    or
    [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
    to put the device into the correct orientation for whichever view I'm about to display.
    Problem is, if the user is on the landscape screen, rotates the phone to portrait, and then presses the button to switch to the screen that is in portrait, the new view gets put on in the wrong orientation (landscape). If the user then rotates the device to landscape and back to portrait, it fixes itself. It's like the phone ignored the call to [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait]; if the device is already being held in portrait orientation.
    I've been at this for a few days now, and I'm really stuck. Any help would be appreciated.

  • Problem using TabBarController and NavigationController in IB

    Does anyone know how to add it? Always can't get both of it working! Please Help!

    Interface Builder
    in AppDelegate:NSObject <UIApplicationDelegate>
    I add TabBarController and NavigationController together, is that correct?
    IBOutlet UIWindow *window;
    IBOutlet UITabBarController *tabBarController;
    IBOutlet UINavigationController *navigationController;

  • Landscape Keyboard for Mail and Notes

    does anyone know if Apple are going to do an update to make the keyboard go into landscape mode for typing emails, notes, addresses and the like? it's so much easier. Why do they restrict it just to Safari where you hardly type?
    Cheers
    Rich

    Please send a request for a horizontal keyboard in Mail.app to http:www.apple.com/feedback/iPhone.html
    Send a request periodically to keep the issue on the iPhone teams agenda.

  • How to force landscape orientation?

    Hello!
    I have a JSP page that generates a html page that is too wide to be printed in portrait orientation. How can I force that the page is oriented as a landscape, when it is printed?

    I don't think it's possible. The only thing you can do from your code is call the print function "window.print()" in javascript. Perhaps display a message to the user advising them to select the landscape format themselves.
    G

  • Forcing naming convention for queries and views

    Hello Friends,
    Can anyone tell me how to Force user to save queries with starting letter 'Q' and all views with 'V'.
    I know how to restrict queries ..
    Please tell me how to Froce Views to save with first letter 'V'.
    Thanks,
    Ram

    you need these values in your role to restrict them save queries with starting letter 'Q' and all views with 'V'.
    S_RS_COMP
             RSZCOMPID-Q*
             RSZCOMPTP - REP
    S_RS_COMP
             RSZCOMPID-V*
             RSZCOMPTP - QVW
    S_RS_COMP1
             RSZCOMPID-Q, V
             RSZCOMPTP - REP,QVW
    and as you know activity will be 01 for giving create ability, don't forget to restrict on infocube and infoarea. one thing you have to rethink is why you want to use Q, V as a starting letter, I would prefer Y,Z.
    and lot of companies do restrict for different naming conventions on different infoarea/infoprovider. just a casual suggestion, it will be better for your company in future, if you restrict the reporting component's naming conventions more specific. something like Zinfoprovider name_reporting component_*.
    regards
    Message was edited by:
            Keerti Vemulapalli

  • Undo typing keeps reappearing/ upside down orientation for games and camera iphone 5

    Hello these are the following issues I keep experiencing with my iphone 5:
    1) Camera elements/options all upside down and do not change when tilting screen
    2) Games are played upside down
    3) Orientation of screen does not change to landscape when tilting
    4) message 'undo typing' constantly comes on when typing in any app
    Please keep in mind I have taken orientation lock off
    please help!!

    I never dropped mine either and its relatively new as well. I am going to to the apple store tomorrow to see what they can do. I heard from someone else it may be an internal hardware problem.

  • Forced to "upgrade" for more $$$ and now my FIOS speed is crippled.

    On Wednesday of this week, I was happily using my FIOS 20/5 service with no problems when I realized my annual agreement for the TV/Internet package was about to expire so I proactively called Verizon to renew for another year of service.
    The agent told me that Verizon no longer offers 20/5 and 25/25 is now the least expensive option that I can choose, resulting in approximately $15 extra per month on my bill. I implored the agent to continue my service at 20/5 for the same price but she was firm with the fact that it was no longer available. Needless to say I was frustrated with the result but realized that I was not going to get anywhere so I accepted the new, more expensive package.
    I was told the upgrade would happen sometime over night and that the new package would be in place by Thursday morning. On a hunch (and also because previous package upgrades have been bumpy) I went to www.speedtest.net and got a result of 19.58 down and 4.40 up - exactly what I would expect with a little bit of overhead for network operations.
    So Thursday morning arrives and I decide to check the speed to verify everything is in place and the first result comes back as 9.95 down and 12.25 up. Hmmm, obviously something changed because the upload speed is now more than double what I had with the previous package but curiously, the download speed is only HALF of what I got with the previous package (the one that's no longer offered). So I call Verizon to begin the quest for an answer.
    First level tech support is of no help. He goes through the standard list rebooting of the router (no change) rebooting the ONT (no change) sending new signals to the router and ONT (no change) and finally escalates the ticket to the next level and tells me that I'll get a call back within 8 hours. Frustrated with this outcome, I try a different avenue for support (the original sales agent) and end up back with first line tech support who informs me that the first tech support guys was wrong and I will get a call back within 24 hours!!! Great, just great.
    Finally get a call back today from 2nd level support and after punching keys for a few minutes, this guy insists everything is correct on the Verizon systems and there must be something wrong with my equipment. I explain to him that I was having no problem getting 20/5 service and NOTHING has changed on my end so how could my equipment be responsible for the speed loss? His only response it to reiterate that everything is correct on his side and all he can do is send out a tech to my house to run test and prove to me that I'm getting the speeds that have been allocated.
    Great, now I've wasted all this time AND I have to waste MORE time on Monday waiting for a tech to arrive (who will almost certainly arrive in the last 30 minutes of the 4-hour window). This is almost the exact same scenario that happened the last time I was upgraded to a faster package. I don't recall exactly how it got resolved but I do remember a tech coming to my house only to find that (shockingly) my router wasn't receiving the speeds is was supposed to be getting and that, indeed, the problem was somewhere in the spaghetti and duct-tape of the Verizon FIOS network.
    Multiple tests throughout this period (both at speedtest.net and speedtest.verizon.net) continue to average around 8 down and 11 up on my connection.
    Anyway - I'm sure this will drag on and on and I will continue to be a dissatisfied Verizon customer. I just wonder why Verizon can't get it right when it comes to customer service. More over, I wonder why I keep giving them my money.
    Solved!
    Go to Solution.

    Jayh. understand your frustration! Why dont you private message me your info so we can take a look into it for you. Thanks Brett
    Brett
    Verizon Telecom
    Fiber Solution Center
    Notice: Content posted by Verizon employees is meant to be informational and does not supercede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.

  • Landscape view/keyboard for Mail and SMS...

    Does anybody know if there is anything in the works to give us larger handed iPhone 3G users the ability to turn the phone sideways for a landscape view and slightly larger keyboard when typing in SMS or Mail like we have in landscape view when typing in Safari?
    Message was edited by: jaytizzle
    Message was edited by: jaytizzle

    Thanks for the links. This was the main (read: only) reason for me not getting the iPhone.
    I love just about everything about it and I have everything mac at home and a mobileme account so the iPhone would complement my needs very well, or so I thought till I used a friend's iPhone for a couple of days.
    Typing emails and using SMS with the keyboard in portrait mode was painful. My fingers aren't that large but found myself spending more time correcting than actually typing. In safari I loved the landscape orientation for typing. I think this is a major oversight by apple.
    I waited till this past week to see if apple releases an update to address this (what with all the feedback people are leaving on boards and forums about this problem), but nothing showed up so I bit the bullet and got myself a Blackberry Bold.
    This was a deal breaker for me. Maybe when they address it I might try out an iPhone in the future.

  • How to read ibooks on landscape orientation one page at a time on iPhone 6 Plus

    How can I force iPhone 6 Plus to show me only one page at the time on landscape orientation on iBooks. Right now it show me one page at the time if it is in portrait orientation but as soon as I turn the phone to landscape orientation it splits and shows me two pages ie page 1 and page 2.

    I've looked everywhere I can think of to change the way that iBooks handles this and cannot find an option to change it. If you choose scrolling view then it will not show two columns but then you scroll to read rather than turning "pages."

  • Touch keyboard and landscape orientation rarely working on my 9800

    Having an ongoing problem with my 9800: Over the past 6 months or so, my 1+ year old Torch has gradually become disoriented, er, it has lost the ability to detect it's physical orientation. This inability to detect the device's actual orientation happens in conjunction with losing the ability to use the touch screen keyboard. I have fat thumbs, so the slider keyboard is frustrating to use.  I mentioned this was a gradual loss of function, meaning that it sometimes resolved itself, but I cannot force it to recover via keyboard reboot, battery & sim pull, making it stand in the corner, etc. Now, six months later, the problem seems to have pretty much burned itself in, so I resorted to a complete wipe & restore. That didn't work either. **bleep**.
    I am beginning to think the forced portrait orientation is initiated by opening (or partially opening) the physical keypad. When that happens, it seems as though the device is not getting the indication that the physical keyboard has been closed. Sort of makes sense. Dirty contacts or micro switch? 
    But I am conflicted because some game apps require you to orient the device to landsacpe. When I use those apps, I will get a message telling me to reoritent the device to landscape - and doing so reorients the screen - but only while that app is in use. Unfortunately, when closing those apps, the verticial orientation problem remains and the touch keyboard is not available.
    Can someone give me any suggestions to fix this? I am eligible for an upgrade, but I am holding out for the BB10 lanuch later this year. This has to be fixable!
    I saw one other post from November, 2011 by another user having the same issue. There were to comiserating replies with the same problem; yet nobody in the community has responded to that post with a possible cause or working solution.

    I have concluded that this is a design fault. It frives me nuts and the only solutions I have seen on the forums is upgrading or re-installing the OS or doing a hard boot. The former does not work and the latter occasionally works. Of course, re-booting every time you slide the keyboard open is not a real solution. Very frustrating.

  • A single report can't combine portrait and landscape oriented pages

    Post Author: joelo2
    CA Forum: Crystal Reports
    Hi,
    Can a single report in Crystal report XI (version 11.5.8.826) combine portriat and landscape oriented pages like Crystal report 2008?   For example, I have one main report with several subreports in the main report.  I want one subreport be in portrait page orientation and the other subreports in landscape.  Can I do something like that in Crystal report XI version?    I even tried writing a small .net program to do this, but it doesn't seem to allow me to do that programmatically either.  Please help

    Post Author: ngra
    CA Forum: Crystal Reports
    I'd like to elevate this issue with Crystal Reports XI. There is a critical application which we developed in-house which needs both portrait and landscape orientation in each of the 30,000 plus documents we are sending out every month.If developers in Business Objects are picking this thread up - we need a patch for this limitation - quick. Right now, we are toying with the possibility of exporting the documents into a text format with markers indicating if a page is portrait or landscape. This is to be loaded into a Xerox machine (which costs hundreds of thousands of dollars), where it is mapped automatically to portrait or landscape. Note to Business Objects: This will provide us and countless others with much value. Think 80/20 rule - most bang for your development bucks and value for your customers!

  • How can I change one section of the document to a landscape orientation and not the whole document?

    How can I change one section of the document to a landscape orientation and not the whole document?

    Page Setup, including page orientation, is done in the File menu. The setting applies to the whole document. As Peter says, you can rotate the contents of a page (not including the text layer of a word processing document).
    As an alternative, you could use Numbers, where Sheets are empty canvases onto which you may place images, charts, tables and text boxes, and where page orientation may be set for individual Sheets. The main tradeoff is that you lose many of the built-in word processing and page layout features of Pages.
    Regards,
    Barry

  • Am creating document with Pages. pages are in "portrait" orientation, but two charts at end need to be "landscape". changing the orientation for one section changes it for entire doc. can i have different orientations in Pages for different sections?

    am creating a document with Pages.  all pages using "portrait" orientation, except 2 appendices need to be in "landscape".  in Word for Windows it is possible to have different page orientations for different sections of a document.  is that possible with Pages.  Even when i put the appendices in a different section, changing the page orientation changes it for the entire doc.

    Make a separate document the size and orientation you want.
    Turn that into a pdf and add it back into the original Pages document or into the pdf from from that document.
    Peter

  • Word 2007 mail merge : problem with mixed portrait and landscape orientations

    Hi there,
    I have a 3 pages document Word 2007 file
    This is a mail merge I want to export in PDF using Adobe Acrobat Printer,
    then send "big" PDF to printing.
    page 1 is PORTRAIT
    page 2 is PORTRAIT
    page 3 is LANDSCAPE
    In PDF pages 1 and 2 are perfectly fine, inside an A4 format (width=210 height=297mm or something)
    but for page 3, system changed to a "double" sized page (A3 width=297 height=420) and printed my stuff at the 1st top middle of big page.
    So I have a big "double" sheet, oriented PORTRAIT, with my stuff in 1st half, and a blank in 2nd half.
    It seems that system did not rotate the page... and just put the stuff into a bigger sheet to "solve" at best.
    I would like the same size of paper (A4) but in landscape : width=297 height=210
    I have already seen many PDF with mixed portrait and landscape orientations, so what's the thing ?
    With my advanced thanks,
    And greetings from Paris, France !
    Vince

    Some questions:
    Which version of office were you using before? 2003?
    Are the data files on a network, or on your local machine? If they are on a network, can you make a copy of one of them on your local machine and try again?
    Can you open the files directly in Excel? What extension do they have (.xls, or something else?) I am wondering whether access to other file types has been left blocked on your machine but is allowed on your colleague's machine.
    Are you just opening the mail merge main document and seeing this message? If so, do you see the same thing if you start with a new document and try to connect to one of these data sources?
    Can you confirm that the message is about Access even though you are trying to connect to an Excel file?
    (Also, office 2007 has some new stuff - that let's you specify that certain folders are "trusted" . I don't think that ever affected MailMerge but it may be as well to make sure that your documents and data sources are in trusted locations).
    Also worth trying to start Word in "Safe mode" - see, e.g. http://office.microsoft.com/en-gb/word-help/work-with-office-safe-modes-HP010140792.aspx
    Peter Jamieson

Maybe you are looking for