uirefreshcontrol

How to customize UIRefreshControl with different image and position?

大兔子大兔子 提交于 2019-11-28 21:42:23
I have been looking around but couldn't find anything good about this. I would like to customize the default UIRefeshControl with different loader, etc. So far I can only change tintColor & attributedTitle properties and most code I found are just basically creating a new "pulltorefresh" effect but what I want is to just use the UIRefreshControl and customize it a bit. Is this possible? You can't add different loader without accessing private APIs, but you can add background image: UIImageView *rcImageView = [[UIImageView alloc] initWithImage: [UIImage imageNamed: @"refreshControl.png"]];

UIRefreshControl on viewDidLoad

落爺英雄遲暮 提交于 2019-11-28 16:52:46
I'm using the following code to create a UIRefreshControl: - (void) viewDidLoad { [super viewDidLoad]; UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(doLoad) forControlEvents:UIControlEventValueChanged]; self.refreshControl = refreshControl; } - (void) doLoad { dispatch_async(dispatch_get_global_queue(0, 0), ^{ // Instead of sleeping, I do a webrequest here. [NSThread sleepForTimeInterval: 5]; dispatch_async(dispatch_get_main_queue(), ^{ [tableView reloadData]; [self.refreshControl endRefreshing]; }); }); } It works great. If

UIRefreshControl iOS 6 xcode

梦想与她 提交于 2019-11-28 16:39:49
Does anyone have a short example of how to implement the new UIRefreshControl into xcode. I have a UITableViewController which displays Tweets, want to be able to pull down and refresh. You can just set it up in your viewDidLoad , if you have a UITableViewController : UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged]; self.refreshControl = refreshControl; Then you can do your refresh stuff here: -(void)refresh { // do something here to refresh. } When you are done with

Header Displaced in TableView with UIRefreshControl

本秂侑毒 提交于 2019-11-28 08:06:22
My UIRefreshController is doing something odd. When I pull-down refresh, the tableView headers are displaced. If I pull-down it looks fine, but if I scroll down the table while the refresher is still working, the headers are offset by the height of the refresh control while the UITableCells are fine and scroll behind the header. I want to avoid creating a tableViewController, and so I am doing the following in viewDidLoad: _refreshControl = [[UIRefreshControl alloc] init]; [_refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged]; [_tableView

swift pull to refresh

徘徊边缘 提交于 2019-11-28 08:03:53
问题 i have my refreshcontroller with a scrollview .. self.refreshControl = UIRefreshControl() self.refreshControl.attributedTitle = NSAttributedString(string: "Frissítéshez húzzad! :)") self.refreshControl.addTarget(self, action: "refresh:", forControlEvents: UIControlEvents.ValueChanged) self.scrollView.addSubview(refreshControl) func refresh(sender:AnyObject) { //my refresh code here.. self.refreshControl.endRefreshing() } I'm adding as a subview to a scrollView . It's working when the page

UIRefreshControl Stuck After Switching Tabs in UITabBarController

隐身守侯 提交于 2019-11-28 07:22:13
I have a UITableViewController as the root view controller in a UINavigationController, which is in turn one of the view controllers in a UITabBarController. All hooked up in Storyboard. I've configured the UIRefreshControl for my table in Storyboard as well, and normally it looks like it should when pulling: However, if I switch between my other tabs once or twice, it looks like this: It's not spinning or anything, just stuck "full", and it stays that way until I pull fully and trigger a refresh. Any ideas or suggestions appreciate. user2009606 was almost right, I fixed it by calling

Why UIRefreshControl jumping?

回眸只為那壹抹淺笑 提交于 2019-11-28 00:55:21
问题 I try to use the UIRefreshControl with swift 1.2 and works fine except the UI. It is jumping and I dont know why. Here is what I am doing: class ViewController: UIViewController { var refreshControl:UIRefreshControl! @IBOutlet weak var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self.refreshControl = UIRefreshControl() self.refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh") self.refreshControl.addTarget(self, action: "refresh:",

UIRefreshControl incorrect title offset during first run and sometimes title missing

风格不统一 提交于 2019-11-27 17:51:45
The text is offset wrong by the first launch of UIRefreshControl... later sometimes the refresh text doesn't show up at all and just the spiny is visible I don't think i had this issue with iOS6... might be related to iOS7 Is in a UITableViewController added as a child to a VC, which resides in a modal presented UINavigationController - (void)viewDidLoad { [super viewDidLoad]; [self setRefreshControlText:@"Getting registration data"]; [self.refreshControl beginRefreshing]; } - (void)setRefreshControlText:(NSString *)text { UIFont * font = [UIFont fontWithName:@"Helvetica-Light" size:10.0];

How do I “hide” a UIRefreshControl?

拈花ヽ惹草 提交于 2019-11-27 15:33:37
问题 Occasionally my table view won't be connected to a service to refresh, and in that case, I don't want the UIRefreshControl to be present. After I add it in viewDidLoad, I've tried hiding it under certain circumstances with setEnabled: and setHidden: but neither seems to work. 回答1: Try setting your table view controller's refreshControl property to nil. 回答2: Try this: [self.refreshControl removeFromSuperview]; self.refreshControl = nil; 回答3: You have several ways to do this. I think the best

UIView under UINavigationBar on IOS7

只愿长相守 提交于 2019-11-27 15:23:23
问题 We're working on the transition between IOS6 and IOS7 and have the next issues, for the moment without solution: The structure of our view is the next one: UIView UIToolbar for ad-hoc buttons (filter button for the list) UISearchBar over the UIToolbar to integrate the search component with the list UITableView Working perfectly on the previous versions of the IOS SDK. But in IOS7 we have the next troubles: The UIToolbar and UISearch bar is not visible anymore We integrated the UIRefreshBar