블로그 이미지
Sunny's

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

'UITableView'에 해당되는 글 2

  1. 2011.09.23 UITableView Selected Row UI 변경 & animation1
  2. 2011.09.22 UITableView 특정 Row의 Height 변경
2011. 9. 23. 15:19 IPhone

UITableView Row UI 변경


NSMutableSet *_selectedIndexPaths;


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

  if ([_selectedIndexPaths containsObject:indexPath]) {

    [_selectedIndexPaths removeObject:indexPath];

  } else {

    [_selectedIndexPaths addObject:indexPath];

  }

  [UIView animateWithDuration:0.5
     
delay:0.0 options:UIViewAnimationOptionLayoutSubviews
      animations:^{
       [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                                withRowAnimation:UITableViewRowAnimationNone];
     
}
      completion:NULL];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

  CGFloat height = 68.0f;

  if ([_selectedIndexPaths containsObject:indexPath]) {
    height *= 2.0f;
  }
  return height;

}




posted by Sunny's
2011. 9. 22. 14:05 IPhone


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

    return ([indexPath row] == MY_TALLER_CELL_ROW) ? 88.0f : 44.0f;

}



참고글 : http://stackoverflow.com/questions/5670093/uitableview-row-height-not-drawing-taller-with-text
posted by Sunny's
prev 1 next