UITableViewControllerにrefreshControlプロパティーがあってそこに設定すれば、実装できることはわかるのですが、UITableViewControllerを使わずに実装する方法はあるのだろうか?
答えはいけそうだ。
UIRefreshControl:オフィシャル版「引っ張って更新」
を参考にすると、単純に、addSubviewをすればいいようだ。
1 2 3 4 5 | UITableView *tableView; UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged]; refreshControl.tintColor = [UIColor redColor]; [tableView addSubView:refreshControl]; |
これは便利。
0 コメント:
コメントを投稿