The point at which the origin of the content view is offset from the origin of the scroll view.
Questions tagged [contentoffset]
140 questions
1
vote
1 answer
How can I prevent jerky scrolling of UIScrollView if I have calculations in EndDecelerating,EndDragging and DidScroll?
I have to update text of a label every time I scroll the UIScrollView...or everytime I scroll and leave it stop at a point on it's own. This updation of the text of the label is done based on the contentoffset of the scrollview. So now I am putting…

keepsmiling
- 66
- 9
1
vote
1 answer
contentOffset skips values in Log
So i have the following code:
int actualPosition = self.collectionView.contentOffset.y;
NSLog(@"%i", actualPosition);
The output is:
2013-03-28 15:36:42.737 test[10544:907] 484
2013-03-28 15:36:42.754 test[10544:907] 490
2013-03-28 15:36:42.770…

schnabler
- 687
- 7
- 23
0
votes
0 answers
Change UITableView contentOffset while user is scrolling
I am changing content offset programically with:
tableView.contentOffset.y += 100
This works well when the tableview is not scrolling at all. But when there is a scrolling animation, or when user is scrolling then it is reverted.
I've noticed…

XFawkes
- 381
- 1
- 11
0
votes
1 answer
How to apply Offset to a Colored bar on Histogram
I'm trying to offset the colored histogram bars to the left 2 spaces(offset= -2). The colored bars represent up and down fractals above and below the Zeroline. I've gotten this far but I can't figure out where or how to accomplish this. The offset…

Roadside
- 1
- 1
0
votes
0 answers
How do you calculate the content offset at a given scale?
I use the calcZoom function to calculate the zoom for linear zooming of a scroll view. But how do I calculate the contentOffset?
startOffset is the contentOffset at startZoom.
endOffset is the contentOffset at endZoom.
var timerA = Timer()
var…

MG1
- 1
- 1
0
votes
0 answers
UIScrollView setContentOffset back to top, stop at incorrect contentOffset
I have a button at the top of UITableView, once I tap the button, will call setContentOffset(:animated:) of this UITableView to back to the contentOffset I want, which is -button.height.
Most of time it works, while since my tableView support…

whitekevin
- 311
- 3
- 15
0
votes
1 answer
UITableView automatically drop down with pagination
I've got a huge legacy project on objective-c and trying to implement new features before we starting to move it to swift.
So I'm working on chat right now and creating "Search" like in telegram.
After we got 200status from server we got 41 message…

Sergey Udalov
- 75
- 1
- 7
0
votes
0 answers
Crash when contentOffset is being updated
let bottomOffset = bottomView.contentOffset.y
let currentOffset = overlayScrollView?.contentOffset.y ?? CGFloat(0)
let totalOffset = (bottomOffset + currentOffset) > 0 ? (bottomOffset + currentOffset) : 0
bottomView.contentOffset.y =…

Rajesh Budhiraja
- 192
- 1
- 12
0
votes
1 answer
VBA- Cell is a number then copy it
I have in E, F and I columns something written. In E and F its a name and in I its a number. In I column there are some cells with number and rest are blank. When ever its a number, I should copy the names from E1, F1 and copy it to C3 and D3…
0
votes
1 answer
Observe current contentOffset during UiTableView's delete rows animation
I set up UI behavior based on tableView's content offset. It works fine and smoothly in all cases excepting one: when tableView starts deleting rows with animation.
The problem appears when before deleting there was a lot of content and a user…

Dmitry Yurlagin
- 1
- 2
0
votes
1 answer
UICollectionView sticky header for specific section in Swift
I'm trying to create a sticky supplementary header for a specific section, which stays on top all the time when the specific section touches on the navigation and won't overlay with other section headers. The solutions I found so far is working till…

Antony Raphel
- 2,036
- 2
- 25
- 45
0
votes
1 answer
UIScrollView: Scrolling content after ViewController View frame change
In a nutshell… I can scroll content however I’m unable to scroll to top to see "all" of the scrollView content after changing the ViewController view frame (the frame Origin Y value is decreased so the VC view moves upward to accommodate the…

imobilizer
- 161
- 1
- 13
0
votes
2 answers
SwiftUI ScrollView with content frame update closure
I want to have a ScrollView where you can be aware of the content frame changes as the user scrolls (similar to didScroll delegate in UIKit UIScrollView).
With this, you can then perform layout changes based on the scroll behavior.

alfhern
- 311
- 4
- 8
0
votes
1 answer
Swift -how is a collectionView's scrollView.content.y determined?
I have a collectionView with 5 cells. After I drag the collectionView down using this scrollView method I can get the following:
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
let currentOffset =…

Lance Samaria
- 17,576
- 18
- 108
- 256
0
votes
1 answer
ScrollView.contentOffset.y can't move less than 0.333 pixel
I'm trying to create a teleprompter. Basically auto scrolling scrollView.
I'm moving my scrollView.contentOffset.y by 1 point/pixel every X time.
I'm giving the user the option to slow the animation down, and I want to do it by moving fewer points,…

ozd
- 1,194
- 10
- 34