Hide DetaiViewController in UISplitViewController in portrait orientation - iphone

i want know if it's possibile to hide the DetailViewController in portrait orientation for the UISplitController template ipad example, and let use the MasterViewController in full screen in portrait orientation, and when the orientation change to landascape use the normal UISplitViewController view, with masterview on the left and detail view on the right...it's possible?

Apple's UISplitViewController has been given a very specific behavior, and cannot be customized this way...
In my company, we had to implement our own SplitViewController - our intent was to handle different display of 'masterViewController' when in portrait orientation, different sizes for both controllers in landscape orientation (than those allowed by UISplitViewController), and a different way to handle 'masterViewController' display in portrait orientation -
This heavy customization led us to deal with all kinds of problems regarding UIViewController containing others UIViewControllers - (UIViewControllers containement wasn't supported by Apple before iOS 5 ! see CoconutKit on Github, or this example for workaround examples...).
For your specific needs, here's Matt Gemmell's own attempt at implementing custom SplitViewController , it's quite good, you can still fork the code to make it fit your own needs.

Related

Making a UIView landscape

I have created an iPhone app, which is a tab bar application and only in portrait orientation.
From one tab I am presenting a modal view which contain UIImage view.
Can I make landscape orientation only to that view while rotating iPhone to 90 degree?
yes , you can.
There are a few settings, code part which need to make it.
Depends also for which version, hopefully aren't targeting all supported by xcode, because it is horrible. Better choose only one, like the lastest iOS.

UIView loaded from segment managing view is not resizing in landscape mode

SegmentManagingView
I am trying to do something like above link. I set the Rotation code in my segmentmanagingview
But it is not resizing in landscape mode.Table's width is 320 px in landscape and portrait mode.Any other way to achieve this?
First read Apple's Why won't my UIViewController rotate with the device or the many links on SO to see if rotation is being allowed. Most of the time this will fix it. Other approaches are:
Implement didRotateFromInterfaceOrientation and implement a relocation (setting new centers for each view).
Duplicate the view and swap the subviews (iterating the subviews and replacing one with the other).
Switch views (create a landscape and portrait view on the same nib and change the active view).
There are examples for all three techniques on the iPhone Developer's Cookbook from Erica Sadun. The source code is free to download, look for chapters 2-3.

Landscape and Portrait Orientations for iPad Apps

I know this question has been asked for many times. I've searched but didn't get the proper answer which one will be able to implement nicely.
Question : How can I handle the Landscape and Portrait Orientations for iPad Apps ?
Note : In interface builder's Size Inspector -> Autosizing we can set the orientations for Images but when we have a complex view how can I change the orientation from Portrait to Landscape nicely ? If we need to call different .xib , how to do that ?
Thanks
You can use the UIViewController reference document
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html
These contain methods like didRotate, willRotate etc and u can override them according to your needs. When the rotation of the view occurs u can adjust the view's size through the auto-sizing options. You can know more about auto-resizing options in UIView reference document
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html
Pls go through the UIViewAutoresizing part.

Iphone sdk custom uiview orientation issue

I am using custom based uiview controller with uitabbar contains uitableview. I am using image for cell background. I want to do orientation from portrait to landscape but the issue is it is not changing on orientation. I just want to know is there are any special thing for custom uiviewcontroller for orientation?
Thanks in advance
Regards,
sathish
If nothing happens when you rotate the device, you either have the system-wide rotation lock enabled (you checked that, right?), or your view controller isn't returning YES to the alternate orientation in its shouldAutorotateToInterfaceOrientation:, or you're doing something odd with your views that means your view controller isn't getting set as the “frontmost” one and thus isn't getting asked about orientation changes. It'll be easier to narrow that down if you post the code you're using to set up the controller and its view.

iPhone autorotation only on specific screens in under a navigation controller

This is just an example of the basic problem I'm having, so don't worry if this situation sounds a bit pointless ;)
Let's say I have an app that's mainly a UINavigationController just two levels deep. The top level is a table with a list of image filenames, and the second level has just a UIImageView showing the image for the filename you tapped.
For an app such as this, does anyone know a good way to allow the table at the top level to autorotate while keeping the second level of images fixed in portrait mode?
So far I've been able to almost get there... but when I tap a filename while in landscape mode, the image slides into view in the wrong orientation even if the second level view controller's shouldAutorotateToInterfaceOrientation returns yes for only portrait modes.
There was no good way to do this in iPhone OS 2.x, but in 3.0, they've dramatically improved it.
In 2.x, the shouldAutorotateToInterfaceOrientation: delegate method was only obeyed for changes to the orientation, so you'd get the behavior you describe: if it was rotated in another view controller, it would stay rotated through pushes and pops even if the new view controller didn't support rotation to that orientation.
In 3.0, UINavigationController polls shouldAutorotateToInterfaceOrientation: on each push or pop and obeys what it returns the way you'd expect, e.g.: if you're currently rotated in Landscape Left orientation, and you push an instance of a view controller that only supports Portrait orientation via shouldAutorotateToInterfaceOrientation:, it automatically and instantly flips the logical orientation and slides in the new view the correct way in Portrait orientation.
Note that this will only work on applications linked against (and therefore requiring) 3.0. For applications linked against 2.x, it will emulate the old behavior.
The problem is that if you use auto rotation the entire UI (including the UIWindow instance I believe) is rotated.
Anything pushed onto the navigation controller at this point will be done in landscape.
So when you push the imageview, that is exactly what you get.
To get this to work, you have to either:
Handle the rotation of the root view
manually (using a transform)
Unrotate the image view by -PI/2
using a transform.
Either way you have to perform the transforms manually to get this to work.
As a side note, this may be bad UI design. As a user, I would expect as I drill down for images to appear rightside up. But this is without knowing the exact context of your app.