UITableView Footer is not showing - ios

enter image description here The Controller is UIViewController.
I have a UIScrollView in UIViewController. A Tableview is added as a subview upon the scrollview. The Scroll view content size is bigger than the screen size. There is a footer in the Tableview. When I am reloading the Tableview first time with the data then the Footer is not displaying but when I started the scroll then the footer is not displaying properly.
Could you please guide me, how to make this resolve.
Thanks

Firstly, it's wrong practise to add UItableview inside scrollview, because tableview already has scrollview underneath it and will adjust the content size of tableview automatically depending on the content you add.
Can you please let me know the reason why you have added tableview inside scrollview?
Remove tableview from scorllview and everything show work fine.

Related

UICollectionView Scrolling the ViewController

Im trying to implement a CollectionView inside my viewController.
And it works just fine.
The problem Im having is that the CollectionView scrolls inside the Parent controller.
I wish to make that if you scroll the collection view - the whole view is scrolled and not just the collection view bit.
I tried disabling scrolling on the Collection View but then nothing is scrolling anymore.
So how would I go about setting the collection view, so that once you scroll on it the whole page scrolls and not just the collection view scrolling inside the parent view controller?
It should be simple, and you've done one right thing already.
Disable scrolling of your collectionView (or tableView, in the future just in case you'll use it, they're basically the same).
Add your collectionView (or tableView) inside a scrollView.
That scrollView is of course in your controller's view.
Make sure every constraints are set properly.
You might need to get the size of your collectionView (say height), and set that height value to the constraint height of your collectionView.
These answers of mine in the past should help you:
https://stackoverflow.com/a/52657995/3231194
https://stackoverflow.com/a/54211275/3231194
https://stackoverflow.com/a/53971539/3231194
Voila. The only scrolling enabled is your scrollView that contains your collectionView (or tableView).

UITableview frame changes after scrolling thanks to Autolayout

I'm working on a application where I have a UITableView inside a UIScrollview.
The TableView will display current games players are in, its inside a UIScrollView. I dynamically add cells to the UITableView for each game, but when I scroll the UIScrollView, the tableview inside it snaps back to its size set in the storybuilder.
This is because of autolayout, when I disable it, it doesn't happen anymore. However I do like autolayout for other views in my app. So my question is, how can I fix this problem?
Maybe someone can help me get on the right track.
Thanks
EDIT
I think I must explain my situation more, I will use an image where I can display what is happening
Explanation
Before and after scrolling.
As you can see I use the scrollview because there can be many games, so you'll have to scroll down to see them all. The TableView is just to hold the data, scrolling is disabled on that. After scrolling the TableView that says "JOUW BEURT" snaps back to its size set in the Storybuilder. This is because of auto layout like I said, but I don't know how to fix this.
You shouldn't put a tableview inside a scrollview as a tableview itself contains a scrollview and causes issues just like you are seeing when you have a scrollview inside a scrollview.
Remove the scrollview and this should fix your issue. If you are wanting to put content above the tableview or where you scroll down to view the tableview cells etc, consider adding a tableview header view that is added above the tableview.
Why did you place UITableView inside UIScrollView?
Check below
Check your constraints of UITableView and UIScrollView
Placing UITableView inside UIScrollView is somewhat strange
EDIT
You will just need to remove the scrollview and enable scrolling feature of the tableview. that will fix it
UITableView is already a subclass of
UIScrollView

UITableView not scrolling inside of UIScrollView

in my view controller I have a ScrollView for content adaptation on various devices .. I need to insert a tableView inside the ScrollView but I noticed that my tableView not scrolling when it is inside a ScrollView. Can someone help me figure out how to fix this?
If you want your table view to scroll set the content size of scroll view less than that of your table view.

ios : tableview not appearing in subview of a scrollview

I have a scrollview with multiple views.Enabled horizontal scrolling.Each view contains a tableview.I have page control in scrollview. when i drag horizontally, the views are appearing without tableview except the first view. Please give me suggestions.
Make sure if setContentSize to your scrollview means scrollview content size is the size of your main view.
When you scroll to next view or if you scroll to view displayed for first time, make sure you reload table. You can implement his through delegate and protocols. For example, when you scroll to second view for first time, then controller should call some method on subview to reload its table.

UITableView dosen't change the size of UIScrollView when adding Cells

The scrollView, which is there with UITableView dose not change it's size.
So I have a UITableView, where Cells are added by the User. Right after adding these cells, I'm calling
[self.tableView reloadData];
Now the tableView shows the new cells added by the User. fine. But, if the tableView get's larger, if it's too big to show everything in the view, it doesen't change the size of my scrollView. I have no scrollView in the view, aside from the "normal" scrollView, which comes with the UITableView. So I can't scroll to the last row, because the scrollView is "too small".
Is there anything I forgot? I'm thinking of something like
[self.tableView.scrollView reload];
I'm using the same concept in another class: The user is able to add cells and they're shown. But in the other class the scrollView "resizes" correctly.
I assume that you have table inside a scrollview. You need to change content size of scrollview after adding cells. Height of content size should change according to content in scrollview so that you can scroll through whole content.
Updated answer:
I think your tableview's frame is larger. It is crossing window's bounds. Try minimizing tableview's height.

Resources