I have Viewcontroller "Home" that have Menu button on navigationBar, when user click on meny i display ViewController over home to display Menu.
To do this i set "Defines context" to the home ViewController
and Presentation to "Over Full Screen" to the menu ViewController
Menu containt buttons that have segues to new storyboard that contains UINavigation and ViewControllers
On that ViewControllers i have this function
override func prefersStatusBarHidden() -> Bool {
return true
}
This function is called but StatusBars is not hidden
I have "View controller-based status bar appearance" set to YES
The problem come from "Over Full Screen" because when i change it, it work but for my design i need to use "Over Full Screen"
Related
I have a problem with adding tab bar to all the controllers in the screen, it's only shown in the controllers that is directly connected to the tab bar. How can I show It in all screens?
I found the answer, my problem was I didn't add navigation controller for each tab bar item, I made only one navigation controller that's why the tab bar didn't appear.
The right sequence is:
TabBarItem1 -> NavController1 -> ViewController1 -> ViewController2
TabBarItem2 -> NavController2 -> ViewController1 -> ViewController2
I have a tabbar controller with 3 tabs, each tab has navigation controller, on root view controller of each navigation controller i want tabbar and on other view controller in same navigation controller i dont want tabbar.
Any solution?
set self.tabBarController?.tabBar.isHidden = true in viewWillAppear method of your controller when you don't want tabbar
override func viewWillAppear(_ animated: Bool) {
self.tabBarController?.tabBar.isHidden = true
}
Setting alpha value 0 to tab Bar hides all items and including tab bar
You should set the tabbar alpha to 0. This will hide the UITabBar.
However you need to set isUserInteractionEnabled to false since even when its hided, the buttons are there & clickable still!
Hope this helps!
Set Transculent property of Tab bar to true or check the same from storyboard
Set hidesTabbarWhen Pushed property of Tab bar to true or check the same from storyboard
Set Tab bar hidden true on view controller where you want Tab bar and set Tab bar hidden to false on view controller where you don't want Tab bar
I have a tableViewController embedded in my tab bar controller. When a cell is tapped, a segue is launched to another view controller to show the details of that object. However, the Back button is not appearing in the viewDetail. I tried embedding the view into a separate Navigation Controller but that didn't change anything. What am I doing wrong? I currently have Tab Bar Controller -> tableView -> Navigation Controller -> viewDetail (need Back button here to return to tableView).
Here's what I have right now:
Thanks!!
Each UIViewController in UITabBarController could be embedded in an UINavigationController at your convenience, that way you'll be able to use all of the features that you need.
Basically, you need to select the tableViewController, click on Editor menu item, select Embed in and click on Navigation Controller, ta daa.
You can show or hide Navigation Bar if you need it using Interface Builder or programmatically in your Detail viewController as follows:
override func viewDidLoad() {
super.viewDidLoad()
self.navigationController?.navigationBarHidden = true
// Do stuff
}
Set NavigationController to TabBarController, then set NavigationController's rootViewController to TableViewController.
You just have the organization wrong. Currently you have Tab Bar Controller -> tableView -> Navigation Controller -> viewDetail. It should be Tab Bar -> tableview -> View detail. Navigation should be separate pointing to table view. Nothing should be pointing to navigation. It should just point to tableview
It should look something like the above picture
I have a navigation controller where I have enabled hide on tap.It hides at first when I tap on the screen but when I tap again,the nav bar hides but the toolbar does not hide at all and it is obstructing my view. I have already tried settoolbarhidden and toolbar.hidden properties but it does not work.How do I solve this?
EDIT : I need to hide it only on this screen,I need the toolbar for other screens so thats why I have enabled shows toolbar.
EDIT 2 : Let me frame my question better.
When I enter the view controller :
Both navbar and toolbar hides because I have set it to hidden which is good
When I tap the screen :
Both navbar and toolbar shows because I have set it this way in the previous view controller.(If possible,Can I only show/hide the navigationbar on tap not the toolbar?
And lastly when I tap it again to hide both bars :
The navigation bar hides but the toolbar does not go away? This is my problem.
As Per your question you want to show tool bar on a particular viewController. View Controller viewWillAppear Function Hide ToolBar and viewDidDisappear show your tool bar it will show on other view controllers.
" Please check the navigation controller checkbox its disable or not.After that set this on your view controller before your profile view controller "
override func viewWillAppear(animated: Bool) {
self.navigationController?.toolbarHidden = true;
}
override func viewDidDisappear(animated: Bool) {
self.navigationController?.toolbarHidden = false;
}
I think it will resolve your issue.
I had the same problem.
The hideBarsOnTap only work if you placed smth in it. So if it is empty it will stay.
You could just put a blank imageView or Label there for example.
Or if you want it completely blank, your only option is to put a tabGestureRecognizer on your View!
How do you change the the title on the popup window in a split-view project? It currently says "Root View Controller" in a split-view project?
If you don't mind having the same title when it's also in landscape mode (no popup), then in the viewDidLoad method of RootViewController, you can do:
self.title = #"Title Here";
or in IB:
open MainWindow.xib
double-click the Split View Controller
click on the navigation bar (where it says "Root View Controller")
in the Navigation Item Attributes Inspector, you can enter a new title
If you want one title in landscape and another for the popup, that can be done by adding code in the willHideViewController and willShowViewController delegate methods. In the standard split view template, these are implemented in DetailViewController.
The code would be (assuming the left side view controller is a navigation controller like in the template):
//in willHideViewController:
((UINavigationController *)aViewController).topViewController.title
= #"Title For Popup Mode";
//in willShowViewController:
((UINavigationController *)aViewController).topViewController.title
= #"Title For Landscape Mode";