Grouped-table-view-style is a project mainly written in ..., it's free.
Create views for headers and footers of a UITableView with style UITableViewStyleGrouped that are consistent with titles.
The GroupedTableViewStyle
class has a collection of static utility methods
that create views for headers and footers of a UITableView
with style
UITableViewStyleGrouped
. The returned views have a style consistent with
headers and footers generated by tableView:titleForHeaderInSection:
and
tableView:titleForFooterInSection:
, respectively. The client is then free
to modify these views before displaying them with table sections.
heightForHeaderInSection:
returns the height for the header view of the
given section. This method should be delegated to by
tableView:viewForHeaderInSection:
.viewForHeaderInSection:withText
returns a view for the header of the
given section containing the given text. This method should be delegated
to by tableView:viewForHeaderInSection:
. Note that the view returned
only supports one line of text; ensuring this is the responsibility of the
client.heightForFooterWithText:isLastSection:
returns the height of the footer
view containing the given text, which is also dependent on whether the
section is the last section in the table. This method should be delegated
to by tableView:heightForFooterInSection:
.viewForFooterWithText:isLastSection
returns a view for the footer
containing the given text. This method should be delegated to by
tableView:viewForFooterInSection:
.GroupedTableViewStyleViewController
is a utility program to allow comparing
the appearance of views generated by GroupedTableViewStyle
with headers and footers
generated by tableView:titleForHeaderInSection:
and
tableView:titleForFooterInSection:
, respectively. It also demonstrates the
delegation to GroupedTableViewStyle
discussed above.
At the top of GroupedTableViewStyleViewController
is a value
USE_TITLES_NOT_VIEWS
.
UITableView
with titles as headers and footers, set the value
USE_TITLES_NOT_VIEWS
to 1
(true) and then compile and run the program.UITableView
with views generated by GroupedTableViewStyle
as
headers and footers, set the value USE_TITLES_NOT_VIEWS
to 0
(false) and then
compile and run the program.