I have to make an app for iPad which requires a UISplitViewController- like view but with extra navigation bars on the top. Unfortunately, the native UISplitViewController does not have support for this. As an example of what I want, consider the apple documentation site which looks like:
But what UISplitViewController offers is a part of it (Master-Detail controllers only):
So my question is: What is the best way to do this? Should I subclass UISplitViewController(which, I'm a little less confident of) or should I use loadNibNamed: or is there some open-source project out there?
Edit I need to put images, buttons and a search-bar in the extra top bar.
What you need it MGSplitViewController. It allows you to push the split view controller inside a navigation controller.
You can also accomplish what you require by digging in the view hierarchy and planting your view there, but MGSplitViewController would be more elegant.
I've recently developed a library and published on gitHub for IOS devices both iPhone and iPad. It's act like an UISplitViewController but there ara more customization option that you can use. https://github.com/ytur/USController
Related
my designer created this layout:
How can I mimic that on iOS? I tried creating a Segmented Control but didn't work well because it can't be customized after iOS7. So at the moment I'm thinking about a UIPageControl with custom dots like explained here: Customize dot with image of UIPageControl at index 0 of UIPageControl
My problem is also with the concept. Segmented controls are said to be used to flatten/filter results according to iOS human guidelines while UIPageControl has actually different pages...
Is this the best approach? If so, can I make it look like the Android Tab bar?
Segmented control with custom image
UIPageControl with custom image
UITabBar on top (read too many bad things about this approach)
something else
If UIPageControl is indeed the best/correct/possible approach how can I make it look as close as the image? And also move it to the top?
Thanks!
Short answer: Don't do that. You're trying to implement Android controls on iOS. That leads to user confusion and an app that doesn't feel like a native app.
Instead, have your designer create a native app design for both platforms.
It looks to me like the closest analog to what you're trying to do is a tab bar and a tab bar controller (UITabBarController).
EDIT:
If you must implement this UI on iOS, you might have to roll your own. You'd create a new custom parent view controller with a child view controller that you could swap out, and a custom control that triggers the swapping. Conceptually it would be a lot like a tab bar controller.
You could probably set it up using a container view and an embed segue (The embedded view controller would be the starting child view controller) and then use the built-in support for managing child view controllers to swap out the child view controller when the user taps on your control. I've done this sort of thing before. It isn't that hard, and is pretty well documented.
Good day!
How to arrange elements in ViewController so that when you switch SegmentedControll changed the contents of the second bottom half?
How to implement this with autolayout?
Thank you!
Ps. Very similar interface with Instagram (the first and second tabs). The Android turned out using TabHost, and there really tight... Or maybe this differently implemented and easier?
If you want to use a UISegmentedControl, you will have to manually manage switching the view controllers yourself.
You should take a look at these github projects, they provide view controller management coupled with a UISegmentedControl:
SNFSegmentedViewController
SDCSegmentedViewController
The other option is to use a UITabBarController instead. If you want a different look than what is provided by the UISegmentedControl, using the UITabBarController is the better option.
It's nice that back to previous page is so easy by swipe gesture in iOS7, Apple has implemented for you already. We like this feature, but how to implement it on iOS6? Any resource can take reference? Such as open source or design solution.
Please share and thanks in advance.
I'd probably be inclined to use UIPageViewController (which is a nice control that offers swiping between view controllers). If you really want to reproduce the UINavigationController iOS 7 UI (swiping from edges rather than anywhere on the page, all of the navigation bar UX, etc.), it might take a little work. But if all you need is a nice simple swiping between view controllers, UIPageViewController might be a good place to start.
See the Page View Controllers section of the View Controller Catalog for iOS.
I have a few simple apps that are single view. I want to add a 'Info' tab for some instructions, support details, etc.
What is the easiest way to do this? Create new Tabbed Apps and copy the existing code in, or edit the current single view apps? I would prefer if the latter was possible.
Thanks.
I achieved the same in <5 seconds with the below xCode menu option: Tab Bar Controller.
I kept my ViewController classes so my main.storyboard looked like this:
Without understanding more about your current setup your question can't really be answered with any kind of accuracy.
Having said that it's easy enough to add a UITabBarController to an existing app, really all you need to do is change the initial view controller.
I presume you haven't tried searching for an example...
Implementing UITabBarController in code: http://simplecode.me/2011/12/05/tab-based-ios-apps-uitabbarcontroller/
Storyboards: http://mobile.tutsplus.com/tutorials/iphone/ios-quick-tip-creating-a-uitabbar-application-with-storyboards/
I am trying to implement a split view controller like UISplitViewController on the iPad, but I don't want the left pane to be hidden when the device is in portrait orientation.
So I've created a UIViewController subclass for this in IB and it works fine without any sub-view controllers. Now I'm trying to wrap my head around what is required to setup and manage the two UIViewController objects for the left and right panes. In my app, they are going to both be UINavigationController with a UITableView in them.
I've hit a mental road block about how to set this up and was hoping someone could point me to some sample code or give me a recommendation for architecture here...
The only reason to use the UISplitView controller is the show/hide logic it gets you for free. I would think it a lot easier to simply take the two view controllers (Root View & Detail View) and lay them on a standard UIViewController. You can then manage them more diorectly without overriding the intended behavior of the implemented controller.
THe settings app on the iPad does what you are looking for and I believe this is the approach that app takes.
Good Luck!
is setHidesMasterViewInPortrait still a private Api and the app will get rejected?
Create your UISplitViewController instance and then call:
[splitViewController setHidesMasterViewInPortrait:NO];
The compiler will give you a warning message but it will do what you want. You can get rid of the compiler warning by making a category on UISplitViewController that implements that method.