The point at which the origin of the content view is offset from the origin of the scroll view.
Questions tagged [contentoffset]
140 questions
3
votes
1 answer
UIScrollView: More accurate/precise contentOffset value?
I was wondering if there is any way to get a more accurate version of the contentOffset, or estimate/calculate the contentOffset or (preferably) the first derivative of contentOffset of a UIScrollView. I am trying to perform an action when the rate…

RileyE
- 10,874
- 13
- 63
- 106
3
votes
0 answers
content offset of UItableView not working
I am working on an application in which I have a UITableview and in each cell a UITextview. When I select a position, if the cursor position is not equal to that position it will jump upward using two line jump and after reaching that position, on…

imran ali
- 33
- 4
3
votes
1 answer
ContentOffset on Dynamic UITableView
I have hard coded a "loading" cell as the last cell of my table view, when this is generated I call some methods to load in new data from a web service, and when I get the response I save the data, dispatch a notification and call reloadData on my…

Daniel
- 23,129
- 12
- 109
- 154
2
votes
0 answers
CollectionView content offset changes when reload it on last item for Pagination
I am trying to implement pagination in CollectionView which contains three items in a row. For that I used:-
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if (scrollView.contentOffset.y == scrollView.contentSize.height -…

Piyush Naredi
- 159
- 1
- 10
2
votes
0 answers
UITableView setContentOffset not working after beginUpdates called
I have this function to move the tableview up whenever the keyboard shows:
@objc func keyboardWillShow(notification: Notification) {
DispatchQueue.main.async {
let screenScaleFactor: CGFloat = 375 /…

T. Jones
- 21
- 3
2
votes
2 answers
Resizing a view based on Appbar's offset or height
I've been trying to imitate Trivago's very awesome Appbar~Cardview UI transition, but never had a luck for almost a week, I know its an appbar/collapsing/coordinator design, but I'm already exhausted trying, so I ended up with calculating the…

Nestor Briaga
- 33
- 4
2
votes
1 answer
UITableview contentoffset sometimes not working
I have the following code in the viewDidAppear:
DispatchQueue.main.async {
let bottomOffset = CGPoint(x: 0, y: self.tableView.contentSize.height - self.tableView.frame.size.height)
…

Dmitry
- 125
- 2
- 9
2
votes
1 answer
UIScrollView contentOffset returns always zero in Swift
I want to track the position of my horizontal scrollView, yet when I print the contentOffset.x or contentOffset, they always return zero.
This is the code for my class:
import UIKit
class ScrollForecast: UIScrollView, UIScrollViewDelegate…

Myreaux
- 43
- 5
2
votes
1 answer
UIScrollView setContentOffset scrolls outside the content size and doesn't snap in back
I want to scroll to the top of a UIScrollView. You have two possibilities:
setContentOffset()
scrollView.contentOffset
If I use an animation then the scrollview sometimes scrolls to (0, -26) instead of (0, 0). So it scrolls further but then…

testing
- 19,681
- 50
- 236
- 417
2
votes
1 answer
Get custom view bounds from view controller
I have ViewController with multiple custom views. CustomView has an xib called customView.xib and is implemented in CustomView.swift.
CustomView has textfield, and its delegate is implemented in CustomView.swift.
When textfield inside CustomView in…

Spencer_Reid
- 33
- 3
2
votes
0 answers
iOS UIScrollView/UITableView contentOffset gets reset when pushViewControllerAnimated:
I have a simple UIViewController with a UITableView as its view's subview. I want to have the option to hide the tableViewHeader of my tableview. This is working fine - I can adjust the content offset with the height of the headerView and its all…

Petar
- 2,241
- 1
- 24
- 38
2
votes
0 answers
Tableview + UITableViewAutomaticDimension + autolayout + contentoffset + iOS8
The title says it all.
If you open the template "Master-Detail" project in Xcode, and test going from the master VC to the detail VC, you will see that upon returning to the master VC, you will come back to the same underlying scrollview offset you…

Khaled Barazi
- 8,681
- 6
- 42
- 62
2
votes
0 answers
Unable to identify the touches in customview embedded in UIScrollView due to resetting the contentoffset
I have a UIScrollView which holds a custom drawing view. The drawing view is used to draw a large content (10000x10000 pixels). Since I cannot embed huge view inside scrollview [due memory limitations], I have created a custom view which is almost…

praveencastelino
- 21
- 2
2
votes
3 answers
Setting UIScrollView's Position from another ViewController
I am trying to set the position of a UIScrollView by using contentOffset as such:
- (void) navigateToTableViewPosition:(CGPoint)contentOffset {
NSLog(@"Position set method gets called...");
NSLog(@"%@", NSStringFromCGPoint(contentOffset));
…

Gergely Kovacs
- 1,045
- 2
- 10
- 28
1
vote
3 answers
UINavigationBar Large Title doesn't appear when scroll view up
I have implemented a feature, when you press on a UITabBar icon and viewController1 scrolls up using its UIScrollView. It works perfectly, but if I scroll view down and stop somewhere, then switch to another viewController2, then get back to…

artexhibit
- 198
- 3
- 17