When I increase the size of a UITableViewCell
, the section headers styling becomes messy. The code I am using, was suggested in "How to set the width of a cell in a UITableView in grouped style" and is as follows:
I have inherited from UITableViewCell
and created this class:
@implementation UITableViewCellHistory {
}
-(bool) isIPAD
{
return UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad;
}
- (void)setFrame:(CGRect)frame {
if ([self isIPAD])
{
NSInteger inset = 40;
frame.origin.y += inset;
frame.size.height -= 2 * inset;
[super setFrame:frame];
}
}
@end
then in my class with the table view in it I have used the above class as my cell:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == [data numberOfDaysWithData])
{
NSAssert([data hasMore], @"how come we have more sections than days when more is low?");
UITableViewCell *cell = [[UITableViewCellHistory alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
But when I increase the size of the padding further I the headings in the tableview get overlapped by rows. Am I missing something?