My app should have a back end for the admin to change some settings, but in the back end view, I want to use a uisplitviewcontroller,
also the app only works in landscape mode,
the problem is that I have read the uisplitviewcontroller is only used in a root view scenario,
the other problem I noticed is that if I make a test app with uisplitviewcontroller (in root view) as in template, but put the app to only work on landscape mode, the right part of the uisplit doesnt show,,
so what to do? to accomplish a splitview kind of settings happening? (in second view)
* uisplitviewcontroller in a second view (how to make the landscape by default work??)
* uisplitviewcontroller faked with a table and loading views on the right side?? (how to do this??)
thanks!!
so, Im still customizing it,
but I ended up using this
APSplitViewController – a custom SplitViewController
thanks to the developer that this this
Related
I have followed the code here to set the Master/Detail view to show in portrait by adding the following to the Master View Controller.
self.splitViewController?.preferredDisplayMode = .allVisible
Issue I am having is that viewWillAppear is not being called in portrait mode on my iPad, this works just fine in landscape mode. I use this method to fetch data from server.
I know I could hack something into the viewDidLoad and if iPad and Portrait to do this call but I don't think that is the correct way of doing it.
What am I missing here, sorry new to iOS programming.
I am trying to create a simple split view, Master/Detail, application on iOS8. The storyboard is something like the following:
SVC=SplitViewController
TBVC=TabBarViewController
TVC=TableViewController
SVC---(Master)→ TBVC → TVC -> ASplitViewMaster
|
+---(Detail) → ADetailViewRelatedToTheCurrentMasterView
Bascially, the user touches the “Items” tab, and a tableviewcontroller will appear that shows the kinds of items (i.e. Customers, Foods,etc.). The user touches “Customers”, I want to load a master that shows customers and shows the selected customer’s details in the Detail view. If the user touches a different item (i.e. Foods), then a different MasterView and its related details is loaded.
The project that I’ve created is about 95% towards a working model. It works properly on the iPhone. It works properly on the iPad in landscape mode, but the splitview’s displayModeButtonItem only shows a < without a title on the iPad in Portrait mode. I cannot figure out what I am doing wrong, so I hope that you can help me. I am sure that others may find this view architecture interesting, too, so hopefully this solution will help others in the future.
Here is the sample project on which I have been working…
https://4a1e8691fb88b7b41341-80de7026d6700afa799b216d7fcde2cf.ssl.cf2.rackcdn.com/MultipleMasterDetailViewsWTab-iOS8.zip
Anyway, I would appreciate your help to figure out what I am doing wrong.
Thanks for your time and assistance,
Mike
displayModeButtonItem() method handles the left UIBarButtonItem for you.
The UISplitViewController act differently between iPhones and iPad.
In your case -iPad in portrait mode- the master ViewController is presented as a popover, so you shouldn't have a back button nor a title on it, because you are not trying to go back, you are presenting a popover.
Since iOS 8 there is no UIPopover. The underlying UISplitViewController handles the master (primary) and detail (secondary) UIViewControllers and "vends" the displayModeButtonItem. Ideally, the title of that button should be the title of the top UIViewController of the primary viewController stack. It isn't. I've had some luck, when the master root controller is a UINavigationController, setting its title to match its topLevelController's title, but there are still cases where that technique doesn't seem to work.
I am trying to set up a UISplitViewController in a Storyboard with the detail going to a UITabBarController which then goes to a UINavigationController wrapping my first ViewController.
The problem I am having is getting the UIBarButtonItem to show up in the Navigation Item when the device is in the portrait orientation. Should the UITabBarController be the delegate for the UISplitViewController and send delegate message to every child view controller to have them create the bar button item and popover?
I found need for this same solution. I am using it in one of my prototype applications for home-control.
The problem you cite is only the first of a couple of problems you'll run into. I believe i have full the solution now working for both iPad/iPhone (Universal app).
You can read my post here: problem and solution description with sample code at my blog
In summary, you'll run into the following issues (most for iPad imple., some for iPhone imple. when building Universal app.):
The template code in appDelegate sets up delegate incorrectly for the new shape (it really no-longer understands what type of controller is present for the detail view
UISplitViewController delegate calls are not propagated thru the UITabbarController to the tabs correctly
You will need to decide how/when to notify the tab(s) of the current detail selection
When building as Universal App some of the notification now need to happen in prepareForSegue: methods (as some of the other notifications don't happen on the iPhone platform.)
(All of this is shown at my blog post)
You can find example and theory in this site. Very good example.
I'm doing an universal ios game and I'm having an orientation problem. My app is all in landscape mode. If I do presentModelViewController is all ok, but if I do setRootViewController, the new controller appear in portrait mode.
What am I doing wrong?
I'm unsure if this was your problem, but I have an application that starts with one view controller in portrait mode and then I'm trying to present a second view controller in landscape mode. I'm using the setRootViewController technique as well so that I do not have to deallocate/reallocate the second view controller and lose my state information since users will be switching between the two views frequently.
I had the same issue where the second view controller would always be displayed in portrait mode instead of landscape, even though the view controller itself specifies that it never allows portrait mode.
The fix for me was to make sure that in the application delegate I presented the first view controller using
[window setRootViewController:controller];
instead of
[window addSubview:controller.view];
This was an older application, and the original template used addSubview by default. it seems that if there was not an original root view controller specified, the necessary orientation messages will never make it to subsequent view controllers that are set as root. Hope that helps!
Have you set the
UIInterfaceOrientation
key in your info.plist file to your desired orientation? (in this case landscape)
I'm working on an iPad app that uses a UISplitView. Inspired by http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/, I display a button in my detail view when in portrait mode that shows the popover controller. This works great. However, the appropriate UISplitViewControllerDelegate message is only sent when the device rotates. So, when the app first loads (in portrait mode), my navigation button is not visible.
Is it possible to somehow convince the UISplitViewController to send that message on load or something, or do I need to re-implement my own popover logic to get things working?
Thanks,
-Patrick
We had the exact same issue and it turned out that this thread had the right clues. When comparing our app with the SplitView template, we noticed that the split template does exactly what was mentioned here: set the UISplitViewController as the root view controller in application:didFInishLaunchingWithOptions.
Out previous solution linked the split view controller in the XIB directly to the window. While this works it seems the split view has difficulties getting the startup orientation and the missing button occurs. When we removed the link in the XIB and created it in code in the app delegate, everything ran fine.
That's weird. Maybe you missed something. Take a look at the template based on a splitController. It works fine form very startup no matter in what mode the app was loaded.
did you make sure that your UISplitViewController's view is the only subview of your UIWindow, and that you added it inside the application:didFinishLaunchingWithOptions: method of your app delegate