GADBannerView scroll with UITableView IOS - ios

I want to fix the GADBannerView at the bottom of UITableView, the banner shows at the end of the table after scrolling.

Please see this link. It is not possible you have to use a tableview inside a view controller which is better, than you can add a view to view of uiviewcontroller and constrain it at the bottom of view because than tableview is separate view inside main view.
Original answer is below.
Add subview to tableview which doesn't scroll

Related

Scrolling through Table View with embedded Table View Inside a Container View

This is a tableView. The white sections are the tableview cells. In the footer of tableView, I've added a scrollview with 2 containers views embeded with 2 UIViewControllers. These embeded view controllers contains tableView.
Now I'm having a problem with the scrolling. I'm scrolling the main tableview and as I scroll, I'm changing the height of the table footerview on which the scrollview is added. Now the problem is when I scroll through child view controller, I'm not able to scroll to the top of my main tableView. How should I do it? Is there is demo github project which I can refer to any code?
EDIT:
This is how my storyboard looks like:
I want to implement something like Facebook has implemented. I think they are using tableview with page view controller. How can I achieve this?

Adding a fixed-position view on top of a view

I have a UITableViewController inside a UINavigationController. I'm adding a "modal" subview to the tableView, which is a custom UIView when one of the rows is selected.
(It’s modal in spirit, not in the UIKit sense, since Apple doesn’t support modal views on iPhone, I’m adding it with a [self.view addSubview:customView] in my table view’s controller.)
I would like it to appear at the bottom of the screen and stay put there. I can get it to draw at the bottom, but once I scroll the table view, the view moves with it. Here are some illustrations:
Initial position (good):
Position after scrolling (bad):
I'm getting the bottom position by subtracting the height of all the chrome (navigation bar and status bar) as well as the height of the custom view from [UIScreen mainScreen].bounds.
How can I get the custom view to stay put? Should I constantly be adjusting its frame when the table view is being scrolled?
Your best and most flexible option is to switch to using a view controller with the table view as a subview so that you can change its frame and add sibling views. Then, when you want to add a modal you can run an animation to move the table view out of the way and slide the modal view in.
UITableViewController.view is an instance of UITableView. Means you added your custom view into a scroll view and that is why it scrolls. You can try to put your custom view into the tableFooterView property of the UITableView, which is the old school solution.
Personally I would create a container UIViewController and have UITableViewController be a sub viewController of it. Another sub viewController UIViewController or just a simple UIView could represent the footer.

Resize UIView above UITableView

I want to create layout similar to default Weather App in iOS. My view controller has UIView at top and UITableView below it. I want to resize dynamically top view while scrolling table view. I made view controller delegate of table view so I can resize top view while
scrollViewDidScroll(scrollView: UIScrollView)
is called.
The problem is that I want to disable scrolling of table view while resizing top view. Any ides? Or maybe my approach to this layout is wrong and I should use another one?
I also faced same problem as per mine problem, I used my UIView as a header of table view and used the AutoLayout in my View and if you want to disable the scrolling of your table view you can simply use a block for completion of your view resizing and you can disable scrolling of your table until your block will not give completion. Hope this solution will be helpful for you.

Scrolling up UICollectionView don't move a UIView above it

I am working in a profile ViewController. This profile has a main image in a UIView subclass and a CollectionView gallery with some images. I would like to be able to scroll up the UICollectionView and move the UIView too, and if I scroll down, I want to watch again the UIView when the collectionView first item is showed again.
I have tried to do this adding the collectionView and the UIView to a ScrollView, but the UIView only scroll up if I touch it.
In this picture you can see my problem
Thank you in advance
You need to make the view at the top a Header View of the collection view.
Essentially it needs to be an actual part of the collection view if you want this action. (That's the easiest way anyway).
So the collection view will take up the whole screen but it will have a header view. Then when you scroll the collection view the header will move out of view and then come back in when you scroll down again.

UITableView header will not stick to the top of UITableView

I have a UIViewController in my Storyboard and in that I have a UIView which contains a UITableView.
I added another small UIView into the top of the UITableView which contains some buttons and text.
Basically, when the run the app, the UIView which I have placed in the UITableView goes to the bottom of the UITableView for some reason.... It scrolls perfectly with the UITableView, but it stays at the bottom...
How can I get the inserted UIView to stay at the top of my UITableView and still scroll with the UITableView?
Thanks, Dan.
What you're describing is the table view header. You don't add it to the table directly, but rather, you assign it to the table's tableHeaderView property like this:
self.tableView.tableHeaderView = myHeaderView;
Or you can just drag and drop a view into the storyboard at the top of the table view above the first section.

Resources