I've implemented a pull down to refresh that sits above my UITableView.
However, UITableView also has a default setting where if you push up (to reveal rows at the bottom of the table), it also reloads the table data. Since I already have pull down to refresh, I want to disable this. How do I do that?
Thanks!
EDIT: I want to load all the rows of the UITableView at once, not just the visible rows, because I'm not loading too many rows anyway.
It's not that it's "reloading" the cells. If they have been dequeued, then they are being loaded. If you don't want those cells there, then why do you have them in the first place? If you scroll them off the screen they normally get dequeued to improve performance of the tableview. If you don't want this behaviour, then you may not want to dequeue your cells, but tableview performance could be drastically affected.
Related
I am facing a weird issue, UICollectionView reuses cells even if there are enough space in screen and not scrolled also.
I have only two cells in the iPad screen, still every time with reload data, cells getting reused alternatively like below
First time reload - First and Second Cells appear with address 0x00007ff3f2c1a8b0 and 0x00007ff3f2830040 respectively
on the same screen - Second time reload - cells appear with address 0x00007ff3f2830040 and 0x00007ff3f2c1a8b0 respectively.
Can any one help me understand for this behaviour of collection view.
Thanks in advance.
When you call dequeueReusableCell(withIdentifier:) method, you should always expect it to be reused. You cannot predict the order of the cell dequeue.
If you want to be prepared for it, use prepareForReuse() method.
I am using Xamarin iOS and my table view contains multiple types of cells.
All the cells have dynamic height and different contents with multiple sections.
Here suppose I have total 10 cells out of which few are visible and others are hidden. Based on user action, It depends on whether to show or hide the cell.
In this scenario, If the number of cells is less, It's somehow working fine. But flickering and blank space are showing when the number of cells increases.
You need to reload only appropriate section or even rows instead of reload whole tableview.
Please checkout this solutions.
Reload sections in UITableView
I am working on a UITableView which has 2 sections, both of which have exactly 1 row which is a custom cell. This custom cell has a collection view which is used to display various products.
Specific to my issue, the two collection views have 6 cells(three rows in the collection view). However when I load the page, the second section only displays 4 cells (two rows in the collection view). I am using UITableViewAutomaticDimension for the tableview which has the cells that contain these collection views.
I have tried using setLayoutNeeded and layoutIfNeeded, I am calling reload data on the tableView in a number of places. I am reloading the second section specifically as well. However the only way the cell's dimensions get fixed is if I scroll down to the second section, then scroll up to the first and then go back to the second.
I have been stuck on this for the past 3 days and absolutely any help would be greatly appreciated.
However the only way the cell's dimensions get fixed is if I scroll
down to the second section, then scroll up to the first and then go
back to the second.
According to this, I think you should reload your collection views firstly. And then reload your table view.
I was wondering if it is possible to increase the number of preloaded UITableView cells.
The problem is, I have webviews in table cells and when you scroll down, they first show empty screen then load the page. Which doesn't look good.
I thought maybe I can solve this by loading more cells off the screen, so they appear more smoothly.
What do you think about this, is it possible?
You don't need to preload more cells. Instead create a data source implementation that fetches more data.
I have a UITableView into which I populate a small number of static UITableViewCells (about 6 cells). I am not using storyboards. Each of these cells is a custom UITableViewCell, has a different layout, so I my thought is that cell reuse is never going to happen in this case.
So I am creating these cells beforehand and storing them into an NSArray. In cellForRowIndexAtPath I just return the corresponding cell that is already stored in my array.
Everything works fine with this approach on iOS6. However on iOS7, the visible area of the table view goes completely blank. When I scroll up, the part of the table view that was underneath the main view previously shows the cells (partial cell if the cell was partially underneath before). But the initial visible area of the table view still remains blank.
Two questions here - Is it fine to store the cells in an NSArray and return them in cellForRowAtIndexPath? As I mentioned earlier, the number of cells is small and each cell is unique, no reuse is going to happen while scrolling.
And what is going wrong in IOS7?