I am adding a search controller in my app that is part of a tab bar controller. I am trying to get the scope to always show, not just when the search bar is active. I have tried subclassing and overriding the method to always show it, and I have even tried using a UISearchBar and UISegmentedControl separate to seem like the scope is always showing. The issue with that is that the navigation bar height won't change. What would be the best/easiest way of doing this?
(also, for people who have used UISearchController, how can I get the background to extend under the status bar when the UISearchBar is active, like in the mail app)
Related
I use SWRevealViewController for my project. Currently, the problem is that when the project starts, Navigation bar show with title of "MyApp". But, navigation bar disappears when I click on Home
If I add a Navigation Bar in view controller, there will be 2 navigation bars at first run. One navigation will automatically disappear when I click on Home link.
How to do to get the first image appearance when I click on Home link? I'm using Swift 3.
You could try set the navigation bar to not hidden in the viewWillAppear.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.setNavigationBarHidden(false, animated: false)
// ...
}
However I presume the reason the navigation bar is hidden is because the controller is being presented modally and not being pushed onto the main navigation controller. If this is the case, then you will need to probably do something with the SWRevealViewController and push the controller onto the main navigation controller.
Check out the Basic API usage for SWRevealViewController here and here is an alternative that has codeless storyboard implementation and is very easy to configure.
(Posted on behalf of the OP).
I'm not sure the way I solved is right or wrong. But, it works for me.
I remove default Navigation Bar by disabling the bar visibility. Then, I add new Navigation Bar in Home page. After I run the app, my new Navigation Bar appears when I press on the Home button.
One of my views does not display a navigation bar when it runs. From what I can see the attributes are exactly (unless I missed something) the same as other views that work properly.
None of the attributes on the view controller are set. Top Bar is Translucent nav bar.
I also checked the attributes on the Navigation Controller and they were the same, but in case I missed something I created a new one ... no difference. Bar visibility is checked along with Extend edges (top and bottom.)
I've cleaned and restarted Xcode
I haven't (intentionally) changed anything in the custom class for the view controller.
Obviously, I am missing something but what?
i am getting these error:
nested push animation can result in corrupted navigation bar.
Unbalanced calls to begin/end appearance transitions.
I am trying to push one view controller to another one.i am getting following issues:
on that it is not showing title while i gave it in view will appear.
if i turn back it is now showing me blank view (transparent) having that title what i was not able to see in previous view controller.
if now i again turn back, it is showing me right sequence of titles as i am popping but without content.i mean blank (transparent).*
I had the same issue, it turned out to be that I was making two repeated calls to pushViewController:, which presented the same View Controller twice, and when I was going to pop it, the content would stay but the navigation bar would do the animation. I was having this message on the log 'Unbalanced calls to begin/end appearance transitions for ...'
Xcode_5_developer_preview_6 (beta5) is the answer for this. i just installed it. they have resolved this issue which was in Xcode_5_developer_preview beta4.
Short Version:
"How do you get a simple UITable drill down UINavigationController-styled non-full-screen modal dialog on the iPad?"
Long version:
I have a very specific set of requirements that I can't seem to get working...
I have a functioning iPad program that that needs to pop up a non-full-screen modal view. This modal needs to have a navigation controller and a simple drill-down table that displays a detailed view that I can have edit some values related to the selected item in the table.
Of course I am looking to have the regular "Back" and "Delete" buttons in the Navigation Bar.
I can handle the detailed view, what I am having issues with:
Non-full-screen popup (mine is
always full screen no matter what I
try).
The Navigation controller will not display the Table View I tell it to and the navigation bar does not even have the title I assigned to it in IB.
I can't seem to get any of this working. If anyone has a step by step example of how to do this, that would be great,
~Eric
P.S. I am not afraid of doing this 100% programmatically, but all the examples I have been trying to follow (and failing at extending to my problem) use IB.
As for the fullscreen issue, you need to set modalPresentationStyle to UIModalPresentationFormSheet or UIModalPresentationPageSheet on the controller you want to present modally. I'm not sure of a way to do this through IB.
As for your navigation controller/table view, I think more information is needed to provide an answer.
I am working on a navigation based application. I am using navigation controller for this purpose. I want to use tab bar on one of the screens and i am not able to find any way of doing this. As far as i have read, it is not possible to add tab bar controller when you are using navigation controller. Is it right? One solution was to manually add a tab bar on the screen and write its delegate class but in this solution, I will lose "More" button functionality because this thing is handled by tab bar controller itself. Does anyone has any solution to my problem? Please help!!!
You can add a UINavigationController to each of the UITabBarController's tab views but not the other way around.
According to Apple's documentation you cannot push a UITabBarController on top of the UINavigationController. I'm not sure if that is a technical limitation or if they will reject your application when you submit. Either way you shouldn't try to do this.