Move UIView above UITableView when user Scrolls Down - objective-c

I have n UIView above my UITableView.
I would like to have the UIView moves up as if it is "pushed" by the UITableView when user scrolls.
I am wondering how do we create an effect like this?
SCREENSHOT - Before User Scrolls
SCREENSHOT - After user Scrolls, Please notice the UIView above it (Offers, Discover, Most Booked)

The view with 3 buttons needs to be taken as the header view of table. Take the outlet of that view.
[tableView setHeaderView:yourView];
You need to set this in the viewDidLoad of your view controller.

Related

How to pan down a view controller in storyboard

I'm using a scroll view in the storyboard for one of my view controllers and I would like to know if there is a way to move the current view of the view controller down so that I can add things below.
I've seen that when tapping on CollectionView (which is at the bottom of my screen and extends below the view), the view on my viewcontroller seems to move down a bit to reveal more of the CollectionView, but not entirely. Is there a way that I can make the view go lower?
Change the size of viewController as shown in the image below:

Prototype UITableViewCell is not at top of UITableView in Storyboard

As the questions already says: When I add a prototype UITableViewCell to my TableView, the cell is not displayed at the top, here is a image:
How can I get the cell to the top of my TableView again?
The problem is that your trackViewController.automaticallyAdjustsScrollViewInsets == YES, so additional topInset of 64px will be added to first UIScrollView in its view (this is UITableView in your case).
You can do the following:
Set table view origin y to 0
or
set automaticallyAdjustsScrollViewInsets to NO.
In storyboard select viewcontroller (the yellow circle with a white square inside) then click on extend edges under bottom bars option.
Remember to select your view controller not your tableview or tableviewcell.

UIPickerView UIScrolling with view

I have a UIPickerView on a scrollable view with multiple buttons and textfields. UIPickerView picks values into two of the text fields. Now, the problem is UIPickerView is also scrolling along with the page. Can any one guide me how to keep the UIPickerView at the bottom and opaque on a scrollable page?
You need to add the UIPickerView to the superview of the UIScrollView (possibly the view property of the UIViewController that you're working in.
You might also want to extend the contentSize property of the scroll view by the height of the picker view so that all objects in the scroll view can be scrolled on screen and aren't hidden under the picker view.
Take another View on the top of the scroll view and put your UIPickerView into that so it is now independent to your UIScrollView like this:

view on top of tableview shows up below

I have a on top of my tableview another view with 3 buttons on it. You can see my storyboard over here.
When I build and run. This view shows up at the bottom of my tableview. Someone has an idea how this is possible?
Kind regards.
Your UIView is subview of UITableView, to make it on top of the tableView, just drag it out of UITableView scope.
If you select the UITableView then in the Xcode menu Editor->Embed In->View
This will embed the UITableView in a UIView. You can then drag your UIView out from the UITableView and place it at the same level as your UITableView.

Selection of UITabBarItem loading corresponding view

I have a UIViewController named "RootViewController" which contains a UITableView and a UITabBar (2 TabBarItems - Favorites and More).
When the View is being displayed, the TableView and TabBar are visible. Now I want to load an additional view when pressing the other TabBarItem (More). And backwards, but the tabbar should be available. (User can press Favorites)
How can this be done?
BR,
mybecks
If you want the UITabBar to be visible on more than one screen you should use a UITabBarController. That controller should hold your different UIViewController.
It's wheel explain in the documentation on how to implement that controller.