In my application I am using a TableView behind a completely transparent navigationBar.
To achieve this I am setting the top contentInset of the Tableview to -64 for all devices except the iPhone X. For the iPhone X I am setting this value to -88.
My problem is that when I am using the tableView's pull to refresh function the refreshControl is for half shown behind the tableView because the content offset for the refreshControl to be completely shown is -64.
How can I tackle that problem? Is there a possibility to tell the tableView on which contentOffset to start the refresh animation and on which contentOffset to end?
Related
I have an UITableView and I want to hide a part of it's header (kind of pull to refresh). I did it with contentOffset and it works fine when the content is larger than the screen. It hides when needed and show when needed but when the content takes up less space than the screen, it changes the contentOffset from (0,50) to (0,25.5) every time I start to scroll. I think it i not related to my code because I commented out everything that had something to do with contentOffset except the viewWillAppear method what sets the contentOffset the first time. Any idea?
On attribute inspector, unchecked Adjust Scroll View Insets as show in image below
In my app, I have added an UITableView over a ScrollView. I have disabled scrolling in table view.
So, only the scrollView Scrolls, I have adjusted the scroll view content Size with the tableView Frame. So, I can access all the cells.
Consider, there are 5 rows visible in the screen, if I tap any of the row, the didSelectRowAtIndexPath method gets called. If I scroll down, say to 6th cell and tap on it. The method doesnt gets called.
Same issues happens with UIcollectionView.
The reason why I have added so is. When I scroll the Scroll View, a view in that should get fixed in the top and the tableView behind it should go on scrolling. You might have seen in many of the apps in Android. So, I have used the ScrollView didScroll delegate to get the offset position. As per it, I will make the view to be fixed and vice versa.
Make the height of UITableView same as the content height of table.
Then set the content size of UIScrollView as the height of UITableView
Here is a brief example to demonstrate
CGRect rect = tblTopics.frame;
rect.size.height = tblTopics.contentSize.height;
tblTopics.frame = rect;
self.scrlVwFacultyDtl.contentSize = CGSizeMake(self.scrlVwFacultyDtl.frame.size.width, tblTopics.frame.size.height);
In the above example the tblTopics is the instance of UITableView and scrlVwFacultyDtl is the instance of UIScrollView
hope it will help you..
I have an annoying problem with my tableView when i touch a cell which contain an autolayout label (description of the image). The autolayout works well, but, just when i touch the cell before the segue, a cell shifting movement appears (down or up and never the same height).
Don't understand why and this problem is random , I feel it rather happens when a cell is close to appear at the top or bottom.
Here a video of the problem on touch / click on the cell and transition to an another view.
http://youtu.be/kJALa8PhD-U
Image : http://i.stack.imgur.com/uWzDr.png
Reminds something to someone ?
On IOS8 - Swift, Same problem on my iPhone.
Thanks!
Likely what is happening is that because you are using auto layout to get a dynamic height tableviewcell, and iOS is not properly calculating the height of your cells during the segue. Using either the estimatedHeightForRowAtIndexPath delegate callback (if you have varying heights) or the estimatedRowHeight would be my guess at how to fix this.
Doing this should get you two benefits, firstly your views should stop flickering during the segue. Secondly, iOS will not have to look at all of your tableview cells to determine the height of it's scroll indicator (which is good for performance).
I encountered an animation flicker that occurs when dragging down a UITableView. If the height of a UITableView changes during a 'rubber banding' drag, the contentOffset gets set to the contentInset when the table height change animation completes.
Here's a project reproducing the issue, as well as a bad work around. If you drag the table down, you should see the table contents flicker back to the top momentarily.
Anyone have any ideas for a better workaround?
https://github.com/KingOfBrian/AppleBugs/blob/master/ContentOffsetBug/ContentOffsetBug/RZViewController.m
Is there a way to find the x and y position of the side scroll bar and track it as it moves?
You can try taking the position of the scroll from the contentOffset property. But it doen't respond to scroll view delegates methods.