This is kind of a tough thing to search for because of how general the words are. I would like to make a "forward" button for my app, much like the standard iOS navigation "back" button, but obviously pointing the other direction.
So my question is simple: Is there a standard way of adopting the "back" button style, and simply flipping it to make it point to the right? Or do I have to make a custom button background?
Here is a quick 'shopped screenshot of what I would like.
The back button has a set functionality, it pops the current view controller in the navigation controller and returns to the previous one. A forward button does not have a clear semantic as you can push any view controller onto your navigation controller, which is why UIKit doesn't offer it. You'll probably have to emulate it (copying and flipping the graphics), then systematically push a given view controller when the user presses it.
Related
Im sorry if the Title of question isn't 100% correct. To be honest Im not sure how to describe my question. I have problem. I have app which has Navigation Controller (title is called List). In navigation controller I have "Add" item. When I touch the Item, new View Controller is called. When I touch Back button, which is called "List". When I do slide gesture to go back, Button < called "Title" disappear and again appear even if name is same - "Title". I made gif animation to be clear. Does anybody know how to make my app just slide the title without any (dis)appear? Thank you very much and sorry If my english is not best:)
This is the standard UINavigationController behavior and I don't believe you can easily change this. Two options come to mind:
If you really want this feature, the simplest solution is to tell your navigation controller to not show the navigation bar:
Then you can add your own navigation bar to your scenes. You'll have to manually add back buttons that you hook up to IBAction that pops the view controller (or an unwind segue to the previous scene). If your app supports landscape mode, you may also want to tweak the rotation behavior so it's shorter in landscape mode than portrait mode (like the navigation controller does).
By doing this, you still enjoy the navigation controller functionality (pushing and popping), though you're manually adding navigation bars to every scene. The UX isn't going to be identical and you lose interactive pop gesture, too, but it's probably the easiest was to achieve your desired transition animation.
If that's not adequate (e.g. you need interactive gesture for popping, etc.), then you can write this yourself, retiring the navigation controller entirely and then use custom interactive transitions. This was introduced in iOS 7 (see WWDC 2013 video Custom Transitions Using View Controllers) and revised in iOS 8 (see WWDC 2014 video View Controller Advancements in iOS 8).
Frankly, these both feel like heavy-handed solutions (especially the second one), but if you really want to change the animation of the navigation bar associated with the navigation controller, then these are two options. Personally, I'd step back and do a cost-benefit analysis of this endeavor and decide whether this is worth it for a fairly minor UI issue.
I have been working on an app for a while and I designed a menu that when you press the 'menu' button in the navigation controller, it brings up the menu over top of whatever view you are currently on. When you press outside the menu it makes the menu dismiss itself and returns to just the view you were on previously. My problem is that when you press on the cells in the menu, I want it to dismiss the menu and then have the navigation controller on the super view pop to the new view (depending on which cell was pressed). Now I don't know if that is a really bad design or not. If this is possible I would love some feedback on where to get some more information on how to put that into action.
Here is an image of the menu in action running in the app:
If this design for the menu is super complicated or not practical, a push in the right direction on how to implement one would be great. Have tried finding some resources but they are mostly pre-built menu's that you implement and I am not looking to use something like that. That is why I built my own!
In my app I use UINavigationController to navigate through hierarchy of views but I encountered a problem - I need to display a list of buttons (when pushed they go to a view controller) instead of the back button.
What is that functionality called? I know how to change the button title and functionality but don't know how to create this list (a good example of my question is the Facebook left bar which shows Friends and other stuff).
In general you're looking for a drawer. That's what it is usually called. There are many libraries/frameworks out there that implement it in a different way so there is no general approach how to "change back button to...".
Check for yourself:
ViewDeck
DDMenuController
PKRevealController
MMDrawerController
Though, here you will find a very good article about very unique way how to implement this "hamburger" icon feature. They provide nice research and you'll find some very interesting information there.
It seems that you need control like MMDrawerController for showing side menu.
Try to make modal segue or hide back button programmatically. Then you add your own button and configure it. Default back button only return you to previous view, you need to make your own.
I make my first "serious" iOS app, and have some troubles with the whole UINavigation concept, but all in order. I look answers for my questions but don't find what I want, so here it is.
I want to make menu to a game, it would be look like so:
1) It's a RootViewController and it contain some buttons: new game, options, about.
2) I think it will be another view controller (It must appear when we touch new game button, and we see a menu when we choose game difficulty) the buttons is: easy, medium, hard
3) The game view controller (I think that this VC won't be the part of UINavigationController).
I have some concepts that I want to embody in this menu.
Here is it: I don't want to use UINavigationController Navigation bar, I won't use standard slide animation for UINavCon, I want to make my buttons "move to transparency" and come back with another menu from paragraph 2 mentioned above, it's not necessarily to change background or something else except menu items.
I want to use custom back button, and want to add it to the position I want and not to Navigation Bar.
I have some ideas about animation of menu items.
I don't know this:
It is better to use UINavigationController for my purposes or it's better to use normal ViewController?
If I make a UINavigationController can I see it's "child VCs (I mean not a root VC)" in my storyboard or it will be programmatically created thing and I must make it UI in code? If i must do this programmatically, could I make a segue from UINavigationController from storyboard, or I must do this from code too?
Could I make a UIButton, for example, and assign it functions from a normal UINavigationController back button from Navigation Bar?
Some questions might be dumb, but hope you won't judge me hard.
Okay, I'll do my best:
For custom animations, see
Yes, you make a custom segue class with the animation. try: joris.kluivers.nl/blog/2013/01/15/… and developer.apple.com/library/ios/#featuredarticles/… and cmumobileapps.com/2011/11/04/a-short-tutorial-on-custom-segues
Yes, i think a view controller is your best bet. But by the way, even if you use a navigation controller, you still use normal view controllers. A UINavigationController holds different UIViews, which go forward and backward on the navigation stack. Also, you will need to look up what you need to do to hide the navigation controller.
You can see the child view controllers in a storyboard if you create them their, but not if they are created programmatically, unless you just have the view in their.
[self.navigationController popViewControllerAnimated:YES] will "press the back button" programmatically, so just link the custom back button to a method that calls this.
If that doesn't cover all of your questions, just comment and I'll answer any more :)
i am making one iOS tabbar application in that i have put 4 different tabs and whenever i click on 1 st tab and load another view after clicking of the first tab. After that when i press back button then tabbar is not displaying .So that i want hint that how can i show that
back the tabbar when we move from one tab from another and yes how i can use consistent the tabbar in whole application can you just guys help me on this i am new to iOS development.
here i am put the screen shot ...
here first screen is this one..
when i tap the video button that are first in the view then another window open
which are as under and see the tabbar is not there...
when in video controller there is tabbar is there but i drag and connect to that then tabbar is disabled
Looking at your screen snapshots, do I correctly assume you're attempting to transition to the "Videos" scene by touching the big "Videos" button in the center of the "Home" scene (rather than touching the tab bar button at the bottom of the screen, which I assume works fine)? If that's the case, you need to have your button tell the view controller's tab bar controller that you want to change the index of the tab bar, and it takes care of it for you. You cannot do the transition using a segue (or at least not without a custom segue, which is even more complicated than the procedure I outline below). If you're changing the view some other way (e.g. using a standard segue or using presentViewController, pushViewController programmatically, etc.), your tab bar can disappear on you.
You later said:
when in video controller there is tabbar is there but i drag and connect to that then tabbar is disabled
Yes, that's true. You cannot use a segue from one of your big buttons to one of the tabs in your tab bar. (Or technically, if you wanted to use a segue, it would be a custom segue which would do something very much like my below code, though perhaps a tad more complicated.) So, rather than using a segue for your big button, you need to write an IBAction (connected to the big Videos button on the Home scene), that tells the tab bar to change its selection:
- (IBAction)clickedVideosButton:(id)sender
{
[self.tabBarController setSelectedIndex:1];
}
A couple of comments:
My answer was predicated on the assumption that your tab bar works as expected when you tap on the buttons of the tab bar, itself. If you tap the buttons at the bottom of the screen, do you transition to your other views correctly and preserve the tab bar? If so, my answer above should solve your issues in getting the big buttons to work. If not, though, then the problem rests elsewhere and you need to show us your code that might account for that (either you're something non-standard in the UITabBarControllerDelegate methods, or your viewDidLoad of the view is doing something nonstandard).
If I understand your user interface design right, you have the tab bar at the bottom as well as the big buttons in the middle, which presumably do the same thing. That is, no offense, a curious user interface design (duplicative buttons, requiring extra tap on a button, etc.). You might want to choose to either use either big buttons (in which you can retire the tab bar, eliminate the IBAction code I've provided above, and just use a nice simple navigation controller and push segues, for example), or just use the tab bar (and lose the home screen, lose the big buttons, etc.).
You also made reference to "press back button", and I don't see any "back" button on any of your screen snapshots. Do I infer that you have a navigation controller and you're doing a pushViewController or push segue somewhere? If you're doing something with back buttons, you might need to clarify your question further.