Need only tab bar in portrait mode and all viewControllers in landscape mode - objective-c

I am developing an iOS app in landscape mode, except that I need the tab bar to be on the right side(vertically). I was wondering if I could display all the viewControllers(navigation driven app) in landscape mode and only the tabbarController in portrait mode?
In other words, can I set the orientation of all viewControllers to landscape mode and set orientation of only the TabBarController to landscape mode so that I can affectively make it appear on the right side?
Any pointers are greatly appreciated.
Thanks much!

This is probably not the answer you are looking for, but I would highly recommend to open the UITabBarController & UITabBar headers to get an idea on how a tabbar is implemented, and start creating/subclassing your own, instead of hacking the existing components together. You'll need at least a viewcontroller, an array to retain the viewcontrollers represented by tabs, a view to display the active viewcontrollers view and a pointer to the active viewcontroller.
The learning curve for writing your own viewcontrollers is much higher, but trust me, it is worth it.

Related

How to do a portrait and landscape OSX app

Hi I have to develop a Cocoa app for OSX with both orientations (landscape and portrait). My first idea is when the app finish launch to check the screen resolution to see if it is portrait or landscape and then show the landscape view or the portrait view. The views have the same elements, the only difference is the position of them. How do you think is the best way of accomplish this? Two views with two controllers? one controller with two views? Any advise would be appreciated
Thanks

xCode: setView always portrait though device in Landscape

I have encountered a problem developing an iPad app with xCode.
When I load a view into my rootViewController like this
[self setView:viewController.view];
The view is always displayed in Portrait even though the device is rotated to landscape.
I checked all options and tried changing the shouldAutoRotateToOrientation method and it seems to have nothing to do with it.
If I rotate the device to portrait and then back to landscape it works.
Does anybody know why this is happening?
Best regards,
Matteo
The problem was that I was nesting viewControllers which leads to bad behavior like rotation notifications not being sent to certain ViewControllers.

How do you create a slide out tableView on the right instead of the left of iPad Master-Detail Application?

If you create an iPad Master-Detail Application and use Portrait orientation, it gives you a slide out tableView on the left.
1. How do you make it to show on the right?
Also, in the landscape orientation, it is split in into two views.
How do you make it so that it will be the same as the Portrait View, like slide the TableView out?
Is it possible to adjust the size of the Detail View?
If you dont want two views in landscape, why do you need a splitView at all? You can just have a UIView with a popover button on the top bar. Then you can add the tableviewcontroller to the popover. To show it to the right you can define the rect or use the rightbarbuttonitem to add the popover.
You can have master on right by passing masterviewcontroller as second parameter to the array assigned to splitViewController.viewcontroller. However, you cannot resize the master and detail views. Hence you will end up having a bigger masterView than the detailview.
Looking at limited functionality of UISplitViewController, it may not be possible to have master on right(properly working as per your requirements). You can have your own controller to get this done or try using opensource options like MGSplitViewController.
you may also like to look into this discussion

iOS App Portrait and Landscape Views

I'm trying to make and iOS app with both portrait and landscape views, but if I open it and change the orientation to Landscape, some buttons got offscreen, after going to IB and reordering the buttons, in Portrait they go off screen.
After googling, I dont have ANY ideia how to 'change' views according to orientation.
Could you guys give me some help?
Ah, also, Apple Support Documents seems pretty useless to me :P
Thanks!
There a method - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation{}
which is useful in such cases.
You should change autosizing properties in IB (they're in the same place where frame size is) or change autoresizingMask properties of your inner views and controls programmatically. This controls what happens to the elements of your screen after it gets resized (for example when the screen is rotating). You can glue your components to left or right or both, top or bottom or both and similar. Play with it, it's pretty powerful and you don't need any code for that if what they can do is enough.

how to change mainwindow.xib's orientation to landscape? [duplicate]

I appreciate I'm probably missing something basic here, but...
My iPad app will only support landscape mode, and has a MainWindow.xib Window that I'd like to work on in landscape mode in XCode 4, however the pull-down menu to change this (Simulated Metrics -> Orientation) is always grayed out.
I notice that Views can be rotated just fine, it's only Windows that can't be rotated in XCode 4 using this setting.
Is there a workaround for this, or do I have to put a View on top of the MainWindow in order to rotate it?
I think it's because apps always starts up in portrait and then rotates to appropriate oriantations. From the UIViewController docs:
Note: At launch time, applications should always set up their
interface in a portrait orientation. After the
application:didFinishLaunchingWithOptions: method returns, the
application uses the view controller rotation mechanism described
above to rotate the views to the appropriate orientation prior to
showing the window.
So you'll need the UIViewController magic for the simulated metrics to make any sense. If you used the "Window-based application" template as a starting point for your project try the "View-based application" template instead.