iOS Development UI Chapter-a brief introduction to the use of static cells
First, the realization of the effect and description
Description: Observe the above display effect, you can find the entire interface is a tableview to show, the above data are fixed, and almost will not change .
There are several ways to accomplish the above effect:
(1) You can directly use the code, return three groups, in judging how many rows per group, what data to display, so write "dead" code is not recommended to use.
(2) A little more flexible, you can put the plist file a lazy load of the way, loaded into the program, dynamic access. But looking at the interface structure, it is easy to see that this needs to be nested in the model, very cumbersome.
(3)Storyboard provides a static cell this function, can be very convenient to complete the above interface display effect. ( hint: rarely used in real-world development)
Second, the use of static cells to complete the simple interface display process
In a similar development, if the entire interface is TableView, the controller inherits from the Uitableviewcontroller directly.
Modify the host controller to inherit from the Uitableviewcontroller
Delete the default UIView in storyboard and drag a Viewcontroller directly
When dragged into a viewcontroller, it will have a cell on the default, by default, the cell is dynamic, it is invisible by default.
By setting the cell to static, the resulting note that is set to static cell (static cell) in the content of the properties panel must change this property here.
To associate it with the host controller
Next, you can set the displayed picture and text in turn.
There are two ways to set a title:
1 is double-click Change
2 is click on child control lable Modify
Set the number of groups to which the secondary view is set, as required by the interface, and how many rows each group has. Settings group: Click TableView to set the sections property of the Properties panel. Set how many rows per group: Tip : If the written cell does not change, then you can write a group of one line, then copy, slightly modified. Note: static cells are actually in development, rarely used, and are only described here as knowledge points.