iPhone ściągnij odśwież jak Tweetie
Próbuję znaleźć przykład umieszczenia elementu nad widokiem tabeli poza normalnym obszarem przewijania. Jak miałbym to zrobić? Przykładem może być aplikacja Tweetie 2 na iPhone ' a, która odświeża tweety.
Przykładowy kod byłby niezwykle pomocny.
5 answers
Znalazłem odpowiedź na własne pytanie, dla każdego, kto jest zainteresowany.
Wypróbowałem to rozwiązanie i działa świetnie! Jest prawie identyczny z Tweetie Pull Down refresh.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2009-10-30 20:31:01
Oto alternatywa dla EGOTableViewPullRefresh:
Http://blog.leahculver.com/2010/12/iphone-pull-to-refresh.html
Źródło dostępne na GitHubie tutaj:
Https://github.com/leah/PullToRefresh
Jest nieco łatwiejszy w użyciu z punktu widzenia programistów, chociaż w końcu wybrałem EGOTableViewPullRefresh, ponieważ wolałem, jak to wygląda.
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-02-13 14:52:22
Zacznij od iOS 6.0, istnieje standardowa Kontrola o nazwie UIRefreshControl w sdk. apple doc here
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-02-27 09:15:26
Oto co możesz zrobić z iOS 6 i nowszymi:
- (void)viewDidLoad {
// other initialization
self.refreshControl = [[UIRefreshControl alloc] init];
[self.refreshControl addTarget:self
action:@selector(myRefresh)
forControlEvents:UIControlEventValueChanged];
}
Twoja metoda odświeżania:
- (void)myRefresh {
// get refreshed data for table view
}
Kończy się odświeżanie w reloadData:
- (void)reloadData {
[self.tableView reloadData];
// End the refreshing
if (self.refreshControl) {
[self.refreshControl endRefreshing];
}
}
Więc wszystko gotowe!Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-05-22 10:20:06
Szukasz UIRefreshControl, który jest dostępny dla każdego UITableViewController - https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIRefreshControl_class/Reference/Reference.html
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-11-09 21:35:05