views:

304

answers:

1

Is there a way to programmatically get a UITableView's 'grouped' style padding?

I'd like to size some things in my screen but I need to know how far left or right to place them on a grouped UITableView's UITableViewCell.

+1  A: 

Since you are using the grouped style for your table view, you should be able to use the rectForSection: method to get the CGRect where that section will be drawn. You may have to already have added your cells to your view, however.

CGRect sectionRect = [tableView rectForSection:0];
int paddingLeft = sectionRect.origin.x;
highlycaffeinated