Custom UITableViewCell use of summary

In 1.IB not joined cell, otherwise no way to customize the trigger, leading to not use a custom Cell.

2. resolve initialization time, contentView inside the boundaries set questions, call drawRect function inside.

  a. We are here because manually set the height of the Cell, so the process execution method is to be initialized own definition of

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier

Here we first need to call their superiors, and then call the initialization function own set of initialization properties for custom UI controls. Then UILabel this control is not set after initialization Frame size, only the assignment in drawRect, will have problems not displayed. This problem by setting the time frame in which the parameters drawRect resolved, in their own initialization function which is set once resolved. And ensure that imagination can reach the size of the effect.

On the other side, to show TableView inside out, remove the Static CellIdentifier, into a non-static. This prevents the previous problem Cell recurring data is not loaded. Since each Cell data is different, so you should not use the same authentication.

Guess you like

Origin www.cnblogs.com/JMarshall/p/11414987.html