Questions tagged [uirefreshcontrol]

A UIRefreshControl object provides a standard control that can be used to initiate the refreshing of a table view’s contents. You link a refresh control to a table through an associated table view controller object. The table view controller handles the work of adding the control to the table’s visual appearance and managing the display of that control in response to appropriate user gestures.

UIRefreshControl is a control available in iOS 6.0 () and later.

A UIRefreshControl object provides a standard control that can be used to initiate the refreshing of a table view’s contents. You link a refresh control to a table through an associated table view controller object. The table view controller handles the work of adding the control to the table’s visual appearance and managing the display of that control in response to appropriate user gestures.

In addition to assigning a refresh control to a table view controller’s refreshControl property, you must configure the target and action of the control itself. The control does not initiate the refresh operation directly. Instead, it sends the UIControlEventValueChanged event when a refresh operation should occur. You must assign an action method to this event and use it to perform whatever actions are needed.

The UITableViewController () object that owns a refresh control is also responsible for setting that control’s frame rectangle. Thus, you do not need to manage the size or position of a refresh control directly in your view hierarchy.

NOTE: Because the refresh control is specifically designed for use in a table view that's managed by a table view controller, using it in a different context can result in undefined behavior.

References:

493 questions
14
votes
3 answers

Give a top inset to UIRefreshControl

I use an UIRefreshControl like it (without an UITableViewController) : UIRefreshControl *refreshControl = [UIRefreshControl new]; [refreshControl addTarget:self action:@selector(viewDidBeginRefreshing:)…
Tancrede Chazallet
  • 7,035
  • 6
  • 41
  • 62
14
votes
3 answers

UIRefreshControl in Landscape

I've got a UIRefreshControl at the top of my table. The screen is in landscape. The trouble is, I can't pull down far enough in order to trigger the refresh, because there is too little space in Landscape. Is there a way to adjust the amount you…
cannyboy
  • 24,180
  • 40
  • 146
  • 252
14
votes
2 answers

UITableView and UIRefreshControl

I'm trying to move the UIRefreshControl on top of my headerView or at least getting it to work with the contentInset. Anyone know how to use it? I used a headerView to have a nice background when scrolling within the TableView. I wanted to have a…
gabac
  • 2,062
  • 6
  • 21
  • 30
13
votes
2 answers

iOS 11 UISearchController in Navigation Bar with UIRefreshControl causes layout glitch

I am trying to use UIRefreshControl on a table view together with the new searchController API on navigationItem. Now when I set hidesSearchBarWhenScrolling the "pull down to refresh" animation is not showing anymore and the refresh control just…
de.
  • 7,068
  • 3
  • 40
  • 69
13
votes
3 answers

UIRefreshControl bug when entering foreground

I've noticed a little bug (but really annoying) when I use UIRefreshControl in my View Controller. When the application returns from the background the UIRefreshControl is already loaded and it looks like this: As you can see I use a custom…
cojoj
  • 6,405
  • 4
  • 30
  • 52
13
votes
7 answers

UIRefreshcontrol jitters when pulled down and held

I have created a UIRefreshcontrol in my tableviewcontroller as follows in the viewdidload method : refresh = [UIRefreshControl.alloc init]; refresh.attributedTitle = [[NSAttributedString alloc] initWithString:@"Pull to Refresh"]; …
Anum Malik
  • 554
  • 1
  • 7
  • 11
13
votes
3 answers

UIRefreshControl is in wrong position in UITableViewController

I've seen quite a few problems with UIRefreshControl, and I'm having a problem as well with my UITableViewController. The problem occurs so randomly and henceforth I cannot figure out why or how it happens. The problem is that sometimes when you…
klcjr89
  • 5,862
  • 10
  • 58
  • 91
12
votes
2 answers

White line below UIRefreshControl when pulled.. tableView

I am implementing a very basic Refresh control... var refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: Selector(("refresh:")), for: UIControlEvents.valueChanged) refreshControl.backgroundColor = UIColor.red …
user1990406
  • 519
  • 4
  • 16
12
votes
4 answers

Pull To Refresh Jump in iOS

When I slowly pull down to refresh, I see the UIActivityIndicator circle slowly get more complete before it starts the refresh. Just before the circle is complete and the refresh actually triggers, the content jumps/jerks down and then the circle…
tcox
  • 544
  • 8
  • 19
12
votes
2 answers

UIRefreshController goes over the UICollectionView

This is a bug that happens frequently, but not always. I have a refresh control added to my UICollectionView. When I refresh, it works perfectly. However, if I half refresh it several times or even do a full refresh, go to another tab in the app,…
user1941966
  • 449
  • 5
  • 18
12
votes
4 answers

iOS7 UIRefreshControl changes contentInset

I have a UINavigationController in my app. The UINavigationBar is set to opaque and all the scroll views do not overlap underneath the bar. In one view I have a UITableView. The frame of the UITableView is (0 0; 320 504) on my iPhone 5. i.e. the…
Fogmeister
  • 76,236
  • 42
  • 207
  • 306
12
votes
2 answers

UIRefreshControl change color of UIActivityIndicatorView

There is any way to change the color of the "UIActivityIndicatorView" of the UIRefreshControl?? I didn't find anything! Thanks!!
11
votes
1 answer

UIRefreshControl() in iOS 11 Glitchy effect

Every time I pull to refresh the TableView, the UIRefreshControl appears to be glitchy. Below is the code I am using. Any Ideas? In AppDelegate: UINavigationBar.appearance().isTranslucent = false UINavigationBar.appearance().barTintColor =…
lePapa
  • 357
  • 2
  • 11
11
votes
3 answers

Swift - Disable refreshControl while searching

During the search I want to disable the pull to refresh mechanism. So I disabled the refresh control and removed it. But when pull down to refresh the beginRefresh method is called and the cells keep being down for 2 seconds like there is a…
Sven Mäurer
  • 715
  • 1
  • 9
  • 19
11
votes
1 answer

UIRefreshControl added to UIScrollView is never shown

I have decided to use UIScrollView instead of UITableView in my app for many reasons. When I was using UITableView, I was able to add a UIRefreshControl with no issue whatsoever. When I use the same code on my UIScrollView however, nothing happens.…
Connor Hicks
  • 755
  • 2
  • 8
  • 25
1 2
3
32 33