To show master view alone in portrait mode - ios

I am using a UISplitViewcontroller in my iPad app. My requirement is to show just the master view in portrait mode and both master and detail in landscape mode. I tried using a SplitView controller, but it only shows the detail view in portrait mode.
The delegate function splitViewController:shouldHideViewController:inOrientation: will show both master and detail in portrait, but that is not my requirement.
Also it is only supported from iOS 5.0 and my app should support iOS 4.3.

put
self.splitViewController?.preferredDisplayMode = UISplitViewControllerDisplayMode.allVisible
in your MasterViewController

Related

IOS splitviewcontroller and size classes

I Have questions on SplitViewController.
Is possibile to make the same behavior on iPhone and iPad?
I need make on portrait master view and after clicked item show details view. In landscape I need master near details.
My issue is master as slide on iPad at portrait mode ...

How to enable UISplitViewController's preferredDisplayMode = .primaryOverlay setting for iPhone size class

I am trying to use the UISplitViewController for iPhone portrait mode (since it will use navigation controller instead).
I tried to set the UISplitViewController's preferredDisplayMode = .primaryOverlay (which let user to swipe in/out master view from the left). However, this setting only works for iPad and Plus. iPhone still keep using navigation controller, ignoring my setting.
My question is - how to use UISplitViewController for iPhone? I see that Outlook iOS app can do this so it should be possible.
Thanks.
The UISplitViewController only works on iPads. On iPhone it acts like a master/detail view controller. If you want that UI style for iPhone you'll have to implement it yourself.

UIWebView under the Navigation Bar only on portrait mode

My app is a simple Master-Detail applciation, based on a Split View Controller (for the iPhone 6+).
The Master View is listing the news of my Web Site, and the Detail View is showing the news, embedded in a UIWebView.
The problem is that the UIWebView is starting under the Navigation Bar, but only on portrait mode. On landscape mode, the UIWebView is correctly displayed. Here 2 screenshots :
Portait mode
Landscape mode
As you can see, the head of our dear French minister is cropped in portrait mode !
Any ideas on how to fix that ?

Landscape-only IPad App With UISplitViewController

I am almost done developing an app. Right now I'm converting it to a universal app by supporting iPad to supported devices as well.
Can I set the app to use Landscape orientation only, since I am using UISplitViewController and want the Master View Controller to remain on the screen all the time? Is there any Apple policy that states that I cannot restrict it to Landscape only and I have to implement both portrait and landscape? Is there any chance my app can be rejected by setting it to Landscape only for iPad?
Don't worry, you'll be fine. Support both landscape orientations and neither portrait orientation if you want. I've got apps in the store that are like that.
However, note that UISplitViewController does have an option to keep both views on the screen all the time even in portrait. Use the delegate method splitViewController:shouldHideViewController:inOrientation: to forbid hiding the master view:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UISplitViewControllerDelegate_protocol/Reference/Reference.html#//apple_ref/occ/intf/UISplitViewControllerDelegate
So if your only reason for being landscape only is that you don't want to hide the master view, it is a false reason. Look, for example, at Apple's Settings app, which works like that; it is a split view controller that always shows both views in all four orientations.

Strange behavior of Split View Controller in iOS5 and iOS6

I have a strange behavior of Split View Controller in iOS 5.0 and iOS 6.0 iPad simulators. I created Master View Detail template in Xcode and set deployment targets everywhere to 5.0. I switched Autolayout off and set orientation to landscape only.
My app works as follows - Split View Controller is my root VC and because I need to display login first I use
- (void)viewWillAppear:(BOOL)animated {
[self presentModalViewController:[self.storyboard instantiateViewControllerWithIdentifier:#"loginVC"] animated:NO];
}
in the MasterViewController. Everything runs smoothly on iOS 6 simulator, but the 5.0 just won't display the login VC and shows the rest in portrait mode, but turned to landscape. Picture attached below.
Anbody knows what could be wrong?

Resources