How to determine margin of a grouped UITableView (or better, how to set it)?

Grouped TableView Width in Relation to Cell Margin

TBWidth (0 to 20)
Left Margin = TBWidth – 10

TBWidth (20 to 400)
Left Margin = 10

TBWidth (401 to 546)
Left Margin = 31

TBWidth (547 to 716)
Left Margin = apx 6% of tableView

TBWidth (717 to 1024)
Left Margin = 45

- (float) groupedCellMarginWithTableWidth:(float)tableViewWidth
{
    float marginWidth;
    if(tableViewWidth > 20)
    {
        if(tableViewWidth < 400)
        {
            marginWidth = 10;
        }
        else
        {
            marginWidth = MAX(31, MIN(45, tableViewWidth*0.06));
        }
    }
    else
    {
        marginWidth = tableViewWidth - 10;
    }
    return marginWidth;
}

Leave a Comment

tech