çalışmıyor. Başka bir deyişle, bazen aşağı çekerken yenileme işlevini çağırmaz. Bunu nasıl çözebilirim?UIRefreshControl benim toplama görünümüne bir <code>UIRefreshControl</code> eklemiş toplama görünümünde
0
A
cevap
0
#pragma mark UIRefreshControl
- (void) setUpRefreshControl {
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
//add UIRefreshControl to Collection view
[self.collectionView addSubview:refreshControl];
}
- (void)refresh:(id)sender
{
UIRefreshControl *refreshControl = (UIRefreshControl *)sender;
// End the refreshing
if (refreshControl) {
[refreshControl endRefreshing];
}
}
0
Eğer UITableViewController
sınıfını kullanmıyorsanız, o zaman
UITableViewController *tableViewController = [[UITableViewController alloc] init];
tableViewController.tableView = self.myTableView;
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self action:@selector(refreshTV:) forControlEvents:UIControlEventValueChanged];
tableViewController.refreshControl = self.refreshControl;
- (void)refreshTV:(UIRefreshControl *)refresh{
NSLog(@"Refresh");
[refresh endRefreshing];
}
0
aşağıda do İşte UIRefreshControl bir örnektir. aslında aşağıda refreshTV
varken
UIRefreshControl *control = [[UIRefreshControl alloc] initWithFrame:CGRectZero];
control.tintColor = someColor;
[control sizeToFit];
[tableView addSubview:control];
0
Sen yenileme kontrolü için hedef işlevi olarak refreshCV
ekleyin. Gerçekten hangi işlevi istediğinizden emin olmak için kontrol edin.
+0
hata ile ayarlayın –
0
Bunu deneyin https://stackoverflow.com/a/14693598/2284065 yanıtlayın. alwaysBounceVertical
koleksiyon görünümünün değerini ayarlamanız gerekir.
İlgili konular
- 1. Toplama()
- 2. Düğme tıklat yöntemi toplama görünümünde çalışmıyor
- 3. belgelerin sayısı Bu benim kodudur toplama
- 4. Toplama işlevleri
- 5. UITableView Seçim Toplama Sorunu
- 6. Veri Toplama Toolbox?
- 7. Backbone.js + Rest. Toplama, getirme()
- 8. Python numpy toplama hatası
- 9. TClientDataset'te hesaplanan bir alanı toplama
- 10. bir toplama işlevi veya Madde
- 11. Pandalar AYDK toplama
- 12. Form Toplama Hatası
- 13. Özürlü Çöp Toplama Bildirimleri
- 14. Android OpenGL 3D toplama
- 15. pandas serilerinde toplama veya bölme için toplama veya bölme alternatifi
- 16. WPF: Veri toplama toplama içeriğinin Clear/Add olmadan değiştirilmesi
- 17. django - Bir HTML dosyasından veri toplama <select>
- 18. iOS7'de UICollectionView ile UIRefreshControl
- 19. Filtre omurga toplama
- 20. Seti maksimum toplama
- 21. Toplama sütunları nasıl adlandırılır?
- 22. Toplama olmadan Pivot tablolar?
- 23. backbone.js toplama seçenekleri
- 24. SQL: Toplama dizeleri birlikte
- 25. Python'da manuel çöp toplama
- 26. Eşzamanlı toplama boyutu hesaplama
- 27. Mongo toplama sorgusu
- 28. Muhtelif Yapı içinde Toplama
- 29. Rastgele Toplama Dizisi
- 30. ElasticSearch'teki Toplama (Nest)
, bir UITableViewController kullanıyor veya normal UIViewController'da bir UITableView var mı? – Fonix
eğer ikincisiyse, [bu cevap] (http://stackoverflow.com/a/26033824/1219956) – Fonix
adresine bakın. Http://stackoverflow.com/questions/14718850/uirefreshcontrol-beginrefreshing-not-working-when- uitableviewcontroller-is-ins – kb920