The point at which the origin of the content view is offset from the origin of the scroll view.
Questions tagged [contentoffset]
136 questions
87
votes
6 answers
UITableView + Add content offset at top
I need to add some blank space to the top of my UITableView that does not affect the size of the content area. Shifting the content down or adding a blank cell is NOT what I want to do. Instead I just want an offset.
How?
![](../../users/profiles/220770.webp)
bluefloyd8
- 2,032
- 2
- 22
- 19
61
votes
13 answers
How to keep UITableView contentoffset after calling -reloadData
CGPoint offset = [_table contentOffset];
[_table reloadData];
[_table setContentOffset:offset animated:NO]; //unuseful
// __block UITableView *tableBlock = _table;
// [self performBlock:^(id sender) {
// [tableBlock…
![](../../users/profiles/1116905.webp)
avincross
- 613
- 1
- 6
- 5
24
votes
7 answers
Animating UICollectionView contentOffset does not display non-visible cells
I'm working on some ticker-like functionality and am using a UICollectionView. It was originally a scrollView, but we figure a collectionView will make it easier to add/remove cells.
I am animating the collectionView with the following:
-…
![](../../users/profiles/108546.webp)
ravun
- 1,493
- 9
- 25
- 44
24
votes
5 answers
UICollectionView contentOffset changes with custom layout
I have a UICollectionView with a custom UICollectionViewLayout (actually, I'm using this nice layout).
I set contentOffset = CGPointZero in viewDidLoad. After viewDidLoad, however, the offset is -20, and the content gets pushed down like so:
(It…
![](../../users/profiles/374460.webp)
Evan Cordell
- 4,068
- 2
- 27
- 47
24
votes
15 answers
UITableView contentOffSet is not working properly
In viewWillAppear, I have added UISearchBar as my headerview of UITableView. When view loads, I hides UISearchbar under UINavigationBar using contentOffSet of UITableView. When user pull down the tableview the searchbar gets displayed.
After adding…
![](../../users/profiles/932037.webp)
JiteshW
- 2,073
- 4
- 28
- 59
23
votes
4 answers
Smooth move of the contentoffset UIScrollView Swift
I would like to set the contentOffset of my scrollview programmatically when the contentOffset is between two points (please see the picture below) with Swift.
The problem is, I would like to add a smooth transition for the move, but I didn't find…
![](../../users/profiles/3411356.webp)
Jibeee
- 722
- 1
- 9
- 21
16
votes
2 answers
iOS7 Content Offset by 20 pixels for non existent Status Bars
I have a strange behaviour with my UIViews as I'm migrating to iOS7. It seems that they are sent a message to shrink by 20 pixels. I have removed the status bar from all my XIB files and explicitly set it to hidden in the application delegate. My…
![](../../users/profiles/1389383.webp)
Mike M
- 4,447
- 2
- 33
- 49
9
votes
1 answer
iOS: `UICollectionview`, how to get a cell's `contentoffset` by it's `indexPath`
I'm using a UICollectionview with a circular layout. I'm trying to calculate the contentOffsetper item but with the circular layout the full contentsize does not seem match the content.
The collectionview's total contentSize = 780
The content…
![](../../users/profiles/3568731.webp)
Steven B.
- 1,143
- 1
- 12
- 32
9
votes
3 answers
Animating the offset of the scrollView in a UICollectionView/UITableView causes prematurely disappearing cells
We have a UICollectionView with a custom layout very similar to UITableView (it scrolls vertically). The UICollectionView displays only 3 cells simultaneously, with one of them being the currently active cell:
[ 1 ]
[*2*]
[ 3 ]
(The active cell…
![](../../users/profiles/1851965.webp)
radutzan
- 213
- 1
- 3
- 9
8
votes
3 answers
Get current position of UIScrollView
I'm coming from Android and i'm getting a lot of headache in IOS. I need to make a scroll menu like a movie credits. I used the code below:
rol = scroll_view.contentOffset.y;
timer = [NSTimer scheduledTimerWithTimeInterval:.02 target:self…
![](../../users/profiles/1880103.webp)
Rafael Godinho Brandão
- 431
- 1
- 4
- 19
8
votes
5 answers
Detecting UIScrollView Position
I am trying to use a UIScrollView as a navigation device in my iOS application. Basically, I want the application to load specific content, based on the position of a paging-enabled UIScrollView. It is sort of like a navigation wheel.
Currently, I…
![](../../users/profiles/1792135.webp)
Gergely Kovacs
- 954
- 2
- 9
- 25
6
votes
3 answers
How can I set the content offset of a FlatList in React Native?
I know that we can get the offset with
render() {
return
}
handleScroll = (event) => {
//get offset by using
//event.nativeEvent.contentOffset
}
But I'm not sure how to set it
![](../../users/profiles/3734855.webp)
MendyK
- 1,592
- 15
- 28
6
votes
3 answers
UIScrollview animation depending on content offset
I'm using a horizontal UIScrollView, and I want a background color transition depending on the x value of the content offset.
Example: The width of UIScrollView is 640px. When the content offset is equal to 0px, the background color must be red.…
![](../../users/profiles/2246164.webp)
Berendschot
- 2,834
- 1
- 17
- 42
6
votes
5 answers
UICollectionView contentOffset changes when keyboard appears
I am trying to implement PullDown To Search feature in my app. To implement this i just modified bit EGOTableViewPullRefresh
it is working good except an issue.
Issue
When user opens the application following screen shall appear. initially the…
![](../../users/profiles/1280841.webp)
thavasidurai
- 1,934
- 1
- 25
- 47
6
votes
4 answers
Content Offset animation broken
I have an animation which is kicked off when a gesture recogniser (double tap) fires:
[UIView animateWithDuration:0.3 animations:^{
_scrollView.contentOffset = CGPointMake(x, y);
_scrollViewContentView.frame = someFrame;
…
![](../../users/profiles/267075.webp)
Pierre
- 6,557
- 5
- 48
- 78