Skip to content

Commit

Permalink
cell全部刷新改为cell定点刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglei committed May 22, 2016
1 parent 35ae971 commit 9d456c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Binary file not shown.
7 changes: 3 additions & 4 deletions WebView_cell/WebView/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ - (void)viewDidLoad
#pragma mark - table delegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
return 300;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
Expand Down Expand Up @@ -67,14 +67,13 @@ -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPat
#pragma mark - 通知
- (void)noti:(NSNotification *)sender
{
NSLog(@"%@",sender);

TableViewCell *cell = [sender object];
NSLog(@"%@",@(cell.tag));

if (![self.heightDic objectForKey:[NSString stringWithFormat:@"%ld",cell.tag]]||[[self.heightDic objectForKey:[NSString stringWithFormat:@"%ld",cell.tag]] floatValue] != cell.height)
{
[self.heightDic setObject:[NSNumber numberWithFloat:cell.height] forKey:[NSString stringWithFormat:@"%ld",cell.tag]];
[self.tableView reloadData];
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:cell.tag inSection:0]] withRowAnimation:UITableViewRowAnimationNone];
}
}

Expand Down

0 comments on commit 9d456c8

Please sign in to comment.