Changing the location of a search bar in an embedded navigation controller xcode - ios

So currently my app looks like this:
I don't like the blank space at the top of the table view controller, or how the search bar disappears when you scroll down the list. I was wondering if it was possible to move the search bar onto that space at the top for the table view controller, so that it doesn't look empty and the search bar is always at the top of the screen.

Related

Is there a search bar that shows results in a sub screen in iOS/Swift?

I have a screen with a UITableView. I would like to add to it a search bar (that searches on the internet) and shows the found results in a sub screen. When an item on the sub screen is clicked, I'd like to add it to my table. Is there such a search bar in iOS? I added a paint in order to make things clearer.
UITableViewControllers have a restriction: its main view must be a UITableView that takes up the entire screen space (except for a possible navigation bar at the top, and a toolbar or tab bar at the bottom).
If you want to have other views such as a UISearchBar you must use a UIViewController and add a UITableView and a UISearchBar

Placing items above table view in a table view controller that do not scroll Swift

This issue is something I have been struggling with for a while and have been able to get around for the most part by using was seem like hacky techniques but I am needing a better way to accomplish this now.
My question is how do you add UI elements above a table view (in a table view controller) and make them stick to the view (the should not scroll with the table view). For example adding a navigation bar is simple because you can just embed in a navigation controller to the table controller. But what if you want to add say a tab bar below the navigation bar but above the table view? So that the table view scrolls and the tab bar sticks to the bottom of the navigation bar and does not scroll with it.
Ive tried to do this by placing it in the storyboard just below the navigation bar and just above the tableview but it just scrolls with the table.
Any help on this is very much appreciated!

Remove the gray bar at the bottom of view controller - iOS

The image shows the View controller and the bar I want to remove. And also the structure of the view controller:
Someone told me how to remove the grey bar present at the bottom of the view controller as shown in the image. Unable to select and delete the bar. When I try to add the tab bar in that place, it goes behind the grey bar and becomes invisible.
What do your simulated metrics look like?
Can you get rid of the bar by changing the bottom setting?
Couple of things - if you are using autolayout, just make a constraint to the bottom of the container, with 0 value for the constraint. That will take it to the bottom. Second thing I would add is a zero size table view footer to the tableview.
This is a toolbar that comes with the UINavigationController that the View Controller is embedded in. Assuming you have a Navigation Controller on the storyboard connected to the view controller, select it and in the attributes inspector deselect "Shows Toolbar". If you want to do this in code you can get and set isToolbarHidden on a UINavigationController instance.

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.

UISearchBar covered up when searching

I have a UISearchBar and a UITableView positioned inside the view of a UIViewController. The table itself and the search function are working fine, but there is a problem with how the search results are layered over the top of the search bar. I'm sure there is something I have misconfigured, but being new to iOS development, I cannot figure out exactly what it is.
This is how the UISearchBar and UITableView are currently positioned within the view:
However, when your tap the search bar, the transparent overlay which appears covers it up. I would expect it to only appear below the search bar or perhaps for the search bar to move up?
If you begin to type, the search results appear, but the search bar itself has now been completed covered up:
I have tried the following:
Moving the UISearchBar to the header of the UITableView. The result of this is that, when searching, the search bar is moved to the very top of the view but when the search has finished, it then is positioned way off the the left so only the very right edge of the search bar is visible!
Disabling the Under Top Bars and Under Bottom Bars options under the Extended Edges options for the view controller (options in Xcode Interface Builder). This results in the same problem, except the Tab Bar and Nav Bar are a different colour (see image below, with keyboard hidden):
This view has been built using a Storyboard. Here is the heirarchy for reference (the Scroll View is hidden in all the screenshots as it only appears on the right once a search result has been tapped):

Resources