iOS-OC-设置UITableViewCell之间的间距

重新设置的UITableViewCellframe。

代码如下:

[objc] view plain copy
  1. #import "MyViewCell.h"  
  2.   
  3. @implementation MyViewCell  
  4.   
  5. - (void)awakeFromNib {  
  6.     [super awakeFromNib];  
  7.     // Initialization code  
  8. }  
  9.   
  10. - (void)setFrame:(CGRect)frame{  
  11.     frame.origin.x += 10;  
  12.     frame.origin.y += 10;  
  13.     frame.size.height -= 10;  
  14.     frame.size.width -= 20;  
  15.     [super setFrame:frame];  
  16. }  
  17.   
  18. @end 

效果如下:

iOS-OC-设置UITableViewCell之间的间距