SORU
24 NİSAN 2012, Salı


UİTableViewController olmadan UİTableView yenilemek için çekin

Bir UİViewController içinde bir UİTableView özelliği yenilemek için bir istek uygulamak için çalışıyorum. Bu UİTableView yukarıda başka şeyler ile görünüm denetleyicisi küçük bir küme olmak istiyorum çünkü bir UİTableViewController kullanamam. Bunun mümkün olduğunu düşünüyorum, ama herkes bir uygulama gören var mı?

CEVAP
21 ŞUBAT 2013, PERŞEMBE


Doğrudan ** 3, kullanın bu kodu kullanmadan UITableView bir yenileme için bir kontrol eklemek için:

Swift

override func viewDidLoad() {
    let refreshControl = UIRefreshControl()
    refreshControl.addTarget(self, action: "refresh:", forControlEvents: .ValueChanged)
    tableView.addSubview(refreshControl)
}

func refresh(refreshControl: UIRefreshControl) {
    // Do your job, when done:
    refreshControl.endRefreshing()
}

Objective-C

- (void)viewDidLoad {
    UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
    [refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
    [self.tableView addSubview:refreshControl];
}

- (void)refresh:(UIRefreshControl *)refreshControl {
    // Do your job, when done:
    [refreshControl endRefreshing];
}

Not:UİRefreshControl eklediiOS6

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • BrandonHarrisWalker

    BrandonHarri

    27 Kasım 2006
  • SalGames2016

    SalGames2016

    17 Kasım 2012
  • sinumatic

    sinumatic

    19 Aralık 2006