Лучшая практика программирования для этого подклассов ваш UITableViewCell и переопределить его setFrame метод.
- (void)setFrame:(CGRect)frame {
frame.origin.x += 10;
frame.size.width -= 20;
[super setFrame:frame];
}
Кроме того, вы можете установить радиус угла и цвет ячейки в DrawRect метод
- (void)drawRect:(CGRect)rect {
[super drawRect:rect];
// border radius
[self.layer setCornerRadius:5.0f];
// border
[self.layer setBorderColor:[UIColor colorWithRed:0.00 green:0.60 blue:1.00 alpha:1.0].CGColor];
[self.layer setBorderWidth:1.0f];
}
еще одна вещь, если вы просто хотите, чтобы сделать клетку немного более привлекательным добавить этот метод тоже в DrawRect:
[self.layer setShadowColor:[UIColor lightGrayColor].CGColor];
[self.layer setShadowOpacity:0.8];
[self.layer setShadowRadius:3.0];
[self.layer setShadowOffset:CGSizeMake(2.0, 2.0)];
self.tableView.contentInset = UIEdgeInsetsMake (0, 20, 0, 20) –