Put the Navbar fixed while move between tabs - ios

I use the same NavBar in all the views of TabBar, right now I have an Initial TabBarController with five NavigationController and each one with its ViewController.
The thing is that when selecting any section in the TabBar the hole screen, including the NavBar, moves to the selected section.
I need the Navbar and Tabbar to be fixed and only the content in the middle to move when tap to go to some screen.
Hope the description of the problem is clear.
Any ideas what i can do to replicate that behavior?? Thanks!

The reason that is happening is because each tab/view has it's own NavigationController. Instead you need to share one NavigationController with all of the views so that the NavBar isn't a new one every single time

Navigation bar is a part of the navigation controller's view. If you have separate navigation controllers, you essentially have those many navigation bars.
If you just want a single navigation bar / controller and control the content with a bottom bar, you can simply use a toolbar / tabbar (without tabbarcontroller) at the bottom, to navigate / change content

Related

How to segue to view controller without the tab bar disappearing from the main view

I need to segue to another UIViewController from my TabBarController without the tab bar disappearing from the bottom of the view.
As you can see in the picture, I want to segue to the colored view when pressing the red button from tab bar controller with the tab bar still displayed at the bottom of the view.
enter image description here
Set each of your tab roots to be a UINativagationController. Then set the current UIViewControllers as the roots of the navs. Then you can segue as much as you want and the tabbar will remain on the bottom.
e.g.
like the bottom flow, you can add another UIViewControllers to the right again.

navigation bar not coming common to both screens

This is my slide menu in cyan color on the left and dark on the right is my actual window having the slide menu. i need a common navigation bar for both of them but i am not getting it.
I have attached my slide menu with a navigation bar "embed in" and which furthure is connected to swrevelviewcontroller. what should i do to get a single top navigation bar in a situation where the slide menu is visible and the screen also.
First go to storyboard select view controller then check properties from right side.
Then after you need to set UIBarButton(menu/back) manually in all view controller as per requirement. Might be your problem will solved.

How to design a tabbar inside a view

I need to make this view:
A view on top of the tab bar with some data. (image, name, text, ...)
tab bar has a 3 page and every page has a separate view
When user scroll up, tabbar will be scrolling top of the page and a UILable stands top of tab bar. It can be show with some fading animation (not important right now)
this is after scrolling:
I search in cocopods but I didn't find solution.
---- EDITE
I want to know how to put uitabbar inside a view. Is it possible ?
If yes, How to change just sub view of tab bar when I change tab bars!
I want to know how to put uitabbar inside a view. Is it possible ? If yes, How to change just sub view of tab bar when I change tab bars!
Yes, but I wouldn't describe the thing you are showing in your screen shot as a "tab bar". It is a UISegmentedControl. So all you have to do is respond to the user tapping on a segment of the UISegmentedControl by substituting one view for another, and that's easy to do.

Adjusting the position of Navigation Bar Items in Swift

I'm currently designing a Navigation Bar in my storyboard and I wanted to bring my two right side navigation buttons closer together.
How would I go about this? All I have right now is just a regular view controller with a navigation bar on it and two buttons.
I do have my two buttons connected to my ViewController code so I would have no problem doing it programmatically or in the storyboard.
One possible option: add a view as the single item in that position, and then add your buttons to that view.

Placing a share button over a uiwebview

I have an rss app that I'm working on in xcode and the articles load up in a full screen web view. I need to place a "share" button in the navigation bar but since my uiwebview is full screen it won't show up when I run the app. I even tried cropping the top of the web view lower and placing the button there but still no luck. Here is an example of what I mean:
The share button needs to be on the right side of the navigation bar but i cannot seem to figure out how that make that work.
Thanks in advance
Fist of all, your top navigation bar seems to be missing (judging by your image). Since the nav bar is missing there is no possible way that the share button will be visible. You can do this is the IB or in your code.
For your IB you can move the view controller's 'layer's' so to speak. When you place all the elements down, your VC should look something like this:
On the left hand side we can see what subviews are at the top and which ones are at the bottom.
As we can see here that the UIWebView is at the top of the list, so it'll be at the bottom of the pile. The navigation bars are further down the list so they'll be at the top of the pile. So due to this they'll go over the UIWebView.
The other way to do this is using insertSubview:aboveSubview:. Fist of all you'll add your UIWebView using addSubview: and then add the nav bar using insertSubview:aboveSubview: and finally you'll add your button the someway as you did for the nav bar, but this time you'll be adding the button above the nav bar not the web view.
My best guess is that your forgetting to add another navigation bar to the top of the screen. Hope this helps!!

Resources