UITableView is a common and powerful control in the iOS UI
Basic use:
1> set the agent, generally the controller is set as the agent: Self.tableView.delegate = self;
2> compliance with agent protocols and implementation methods
Protocol: Agent protocol: uitableviewdelegate; Resource agreement: Uitableviewsource
A: Resource protocol implementation method: Numberofsectionsintableview tells UITableView to display several sets of data
Numberofrowsinsection tells UITableView that each group of data has several lines
Cellforrowatindexpath tells UITableView what the contents of each line are
B: Proxy protocol: A common method
Row Height: Heightforrowatindexpath
Title of each group: heightforheaderinsection
Description of each group or call Note: heightforfooterinsection
3> display the contents of each group with the cell
=======================================================
Common Properties of Cell:
1: Set up auxiliary views: Accessorytype and Accessoryview
The difference between accessorytype is American drama type: The value is usually fixed several
Accessoryview receives a UIView control: But here the control has a default frame, like: uiswitch;
However, normal does not have a default frame, and if you do not set frame it will not be displayed
2: Set color: Background color, color when selected:
Background color: Backgroundview and BackgroundColor
Difference: Backgroundview priority is higher than backgroundcolor and will overwrite BackgroundColor's display
Second: Backgroundview can receive a control, BackgroundColor is inherited from UIView, can only receive Uicolor
Color When selected: Selectedbackgroundview
UITableView and Cell Properties