I have a similar problem as stated in this thread: iPad UISplitView initial state in portrait: how to display popover controller widget?
The issue is that when my app starts in portrait mode the button for the masterview of the splitview does not show. In the thread mentioned above the solution was to porgrammatically assign the splitview as the window's rootviewcontroller.
For me this will not work as I have my splitview within a tabbarcontroller and that is the rootviewcontroller. Furthermore I have another splitview under a different tab and that has the same issue.
When I rotate the iPad to landscape and back the button appears, but I have to do that for both tabs individually. Also, the button only appears on the device not in the simulator.
Does anyone have a way to trigger the splitViewController:willHideViewController:withBarButtonItem:forPopoverController: ?
I am working from a storyboard in iOS 5, iPad only.
Related
I think I have been through probably 50 versions of this question today. The closest answer I got was putting
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow: (UIWindow *)window{
into my app delegate and
-(BOOL)shouldAutorotate
- (NSUInteger) supportedInterfaceOrientations
into the view controller I want to restrict to portrait mode. In this setup what I found is that the methods in my view controller never get called. The method in my appdelegate gets called whenever I do a tab bar based segue, but not when I do a push segue in a navigation controller.
I've seen several answers that want me to subclass navigation controllers, but there has to be a more straight forward way.
I have an app with three tabs. Tab 1 is just a home screen. Tab 2 has a navigation controller feeding through two tableviewscontrollers, and the last table view segue's into a simple view controller. Tab three goes to one tableviewcontroller which then does a push segue into the same simple view controller where tab 2 terminates.
I want that terminating view controller to always be in portrait. The other scenes should be able to switch between portrait and landscape as needed.
I am in xcode5 IOS7.
Thanks
The real answer to the question is that good apps fall into one of three categories: portrait-only apps, landscape-only apps, and apps that support both orientations in all view controllers.
The UX design goal: the user controls the app, the app does not control the user.
An app that has some view controllers that are portrait-only, and some view controllers that support rotation, is an app that is trying to control the user. Specifically, when the user navigates to the portrait-only view, the app is forcing the user to physically rotate the device in response to the app's whims.
In short, given that you have a view controller that only supports portrait, you should design a portrait-only app. If you don't want a portrait-only app, then you need to figure out how to support rotation on that last view controller.
How to design ui in both portrait and landscape in interface builder in iphone or ipad (Iam using storyboard not xib..)..
Thanks in advance..
If you want design UI using storyboard, In latest iOS version there is option of Out Layout.
Using Autolayout you can manage UI for both modes.
Hope this will help you
http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
Or
Other alternate provided on
iPhone Storyboard: different scene for portrait and landscape
When you add a view controller to the storyboard it comes with a view. Call that the container view. Add two views to the container view: a portrait view and a landscape view. Set the dimension of the portrait view and the landscape view appropriately using the size inspector. Add buttons, more views, labels or whatever to the portrait and landscape views as needed for your application. Then when the orientation changes hide one view and show the other.
Hope this will help you out.
When I switch my iPAD to portrait mode the navigation bar buttons button appears correctly. Now If i choose a table row from popOver View and push a new screen for the master and detail view the navigation bar button disappears and wont appear until I rotate the device to Landscape and then back to Portrait. Does anyone have a idea how to fix this ?
Perhaps you are not setting the delegate in the UISplitViewController
self.delegate = secondViewController;
In my iphone app, i've two view controllers. First one is a portrait and second one is landscape.
When app is started, it will show the portrait view. On click of a button in portrait view, the view transitions to landscape view. Here, i'm using navigation controller.
If both the views are portrait, pushing the next view via navigation controller won't be a problem. How can I achieve transition between portrait and landscape views using nav controller.
Note that status bar is visible and nav bar is hidden.
I would suggest you to use the following instead of pushViewController
[self presentModalViewController:aController animated:YES];
This is the only solution i guess. If you are navigating further from the LandScape mode put the aController inside the UINavigationController and Present the NavController the same way as shown above.
When I present a modal view in iPad, the view comes up from the bottom. But when I dismiss it, it slides of the screen to the left. I'm in landscape mode and using UIModalPresentationStylePageSheet. How do I make the dismiss animation slide the view back down?
See a different solution here: Modal View Controller with keyboard on landscape iPad changes location when dismissed