1 创建并添加一个
UILabel
作为单元格cell的子视图;
2 在UITableView的委托方法: (CGFloat) tableView :(UITableView*) tableView heightForRowAtIndexPath : (NSIndexPath *) indexPath中计算高度
2 在UITableView的委托方法: (CGFloat) tableView :(UITableView*) tableView heightForRowAtIndexPath : (NSIndexPath *) indexPath中计算高度
3 在UITableView的委托方法: (UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath: (NSIndexPath *) indexPath中计算UILabel的框大小。
在单元格cell子视图上添加uivew调用的方法:
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
-(UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section