2011-12-02 23 views

回答

2

是的,你必須手動更改內容表中的偏移和調用表的裝載功能。這將產生相同的效果,用戶看到當他試圖滾動到表的頂部更新內容:

/////////////////////////////////////////////////////////////////////////////////////////////////// 
- (void)reload { 
    if ([self.tableView.delegate isKindOfClass:[TTTableViewDragRefreshDelegate class]]) { 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:ttkDefaultFastTransitionDuration]; 
    self.tableView.contentOffset = CGPointMake(0, -60.0f); 
    [UIView commitAnimations]; 
    } 

    [super reload]; 
} 

然後,只需添加一個按鈕,使用這個重載函數:

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(reload)] autorelease]; 

你可能也需要你的無效數據源,給力的更新,因爲如果數據被存儲在緩存中,刷新阻力會出現,立刻躲起來。

+0

感謝你感謝你這麼多:d – bluezald