(1) Effect
(2) Source code and material download
http://download.csdn.net/detail/wsb200514/8089727
(3) Summary
--You can use the Xib layout cell, but the cell time fixed height of this case
--If each cell is at a different height, the code needs to be used, and the core idea is to calculate the cell's height based on the height of the child controls inside the cell.
--one of the knowledge points used here, to calculate a paragraph of the high-width occupied by text, is to determine the text size, text width, you can use a method to calculate the width of the text, of course, this method returns a lot of things, size is just one of the attributes.
Cgsize Namemaxsize=cgsizemake (Maxfloat, maxfloat); Nsdictionary *[email Protected]{nsfontattributename:[uifont systemfontofsize:14]}; Cgsize namesize=[self.status.name boundingrectwithsize:namemaxsize Options:nsstringdrawinguseslinefragmentorigin Attributes:nameattr context:nil].size;
--The second point of knowledge, because this project opens the homepage is a scrolling view is a tableview, so we can delete the original viewcontroller of the project, create a tableviewcontroller as the main entrance. This controller as the main entrance is set to: is Initial View controller, Hook can be. (Remove the cell that comes with this controller)
--three of the points of knowledge, or encapsulation. Models, views, and controllers perform their duties.
--For variables that provide only outside access, that is, those variables with getter only, add a readonly at @property to prevent others from modifying them.
1 and 0 of the number type data inside the--plist can be converted directly to bool 0 and 1.
--Modify the cell height in addition to the direct use of tableview.cellheight this attribute, there is a proxy method, is the method used in this example.
-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) indexpath{}
-For some controls, if there is something to show, if there is no hidden, this inside hidden property is very important, and Hidden's Yes and no is best to appear in pairs. Because these cells are placed in the cache pool, they will be faulted if not judged if they are not displayed again when they are removed.
"iOS Development-64" Weibo case exercise: Customizing cells with code, primarily for cells of different heights