UISearchbar at the middle of the screen - iphone

I want to position my UISearchBar at the middle of the screen, but I still want it to slide to the top when user starts to edit text like it was positioned strictly under navigation bar.
Do i have to take care of its frame by myself?

Related

How to use a scrollview containing buttons with auto layout

I need some help figuring this out.
I have a simple UI I need to implement. I have 4 buttons that take up the entire screen and with the scrollview, I want the user to be able to scroll to make the 5th button visible. I know how to use auto layout to make my first four buttons display how I want them. The first button is 40% of the visible screen, the second button is 15%, the third 30% and the last button is 15% of the visible screen. The 5th button should be hidden but then revealed when the user scrolls down.
(To clarify, all buttons have width equal to their superview, proportional height to the superview and all buttons have no spacing between each other)
This is where I am stuck. I want the proportions as I stated above, but also want the 5th button to show when scrolled to, possibly at 10% of the now visible screen (with the first button now not showing itself fully). Is there a way to do this?
You can set the contentSize of the UIScrollView to be larger than the visible screen. The buttons can be sized and placed in a way to have all 5 buttons visible (with the 5th button actually off screen). The scrollView will bring the 5th button into view when scrolling.
I worked up a simple prototype using just a storyboard (and setting the contentSize of the scrollview in Runtime Attributes section, but this could be done in code if you need to pragmatically determine the button sizes.

How to move a subview to front and have existing view shift up to make room?

I have a collectionview that takes up the whole screen. Once the user clicks a cell and does stuff in the detail view, they are sent back to the first collectionview screen. At this point, I am bringing a view to the front that is a pseudo-tabbar. I want to shift the collection view up to accommodate this new view. Right now, it is just blocking the bottom row of collectionview cells. Thanks in advance!
Put the pseudo-tab bar in the initial view and constrain your collection view's bottom to the top of the tab bar.
Set the tab bar's initial height to 0. Don't just set it to hidden, because that keeps the view's original height.
When the user returns to the collection view, set the tab bar's height to the desired value. Animating it in will look even better.

the scroll bar is hidden behind the keyboard

I have a UITableViewController with a search bar. When I touch the screen to start the search, I hide the UINavigationBar and show the scope bar search to optimize the space.
For the TableView not hide behind the keyboard and search bar, I add header and footer to the table with their respective heights.
Everything working correctly. But the scroll bar is still hiding behind the search bar and keyboard.
Any suggestions to solve this or some other way to do this whole mechanism?
Resize the table view's frame by subtracting the height of the keyboard.

Disclosure indicator moves slightly when 'edit' is pressed with grouped UITableView

I've changed my UITableView to be grouped in Interface Builder (which looks so much nicer!), but now the Disclosure Indicator against my UITableView row moves a few pixels up and right whenever I press my edit button in my navigation bar (at the same time as the red delete buttons move in)!
Has anyone seen this before or got any suggestions?
Edit:
Ive added a screen shot to this question. While it is very hard to notice even on these large screen shots, the chevron in the upper right corner of the second picture is a few pixels up and right of the chevron on the first picture. This is obviously more apparent when it moves in front of your eyes. On the second picture, the edit button has been pressed (which you can tell, because the delete icon has appeared)

Making a view scrollable when keyboard active

I have a view with half a dozen text fields and labels, and a button.
I want it to be that when the keyboard pops up, the view becomes scrollable, so you can scroll the view up and see the bottom half of the fields without having to dismiss the keyboard to get to them.
Just putting it inside a UIScrollView doesn't seem to do it.
You have to set the scroll view's contentSize to enable scrolling.