Set cell height
-(CGFloat) TableView: (UITableView *) TableView Heightforrowatindexpath: (Nsindexpath *) Indexpath
{
noticemessage* msg = [Arraynoticemessage objectatindex:indexpath.section];//take out the corresponding section or cell
Uifont *msgfont = [Uifont fontwithname:@ "Arial" size:15];//set font and font size
Define Row Heights
UINT Textlineheight = [@ "The brown fox jumps over the lazy dog" Sizewithfont:msgfont constrainedtosize:cgsizemake (maxfloat , maxfloat)].height;
Set content Height
Cgsize infosize = [msg.strcontent sizewithfont:msgfont constrainedtosize:cgsizemake (MAXFLOAT) LineBreakMode: Uilinebreakmodewordwrap];
return infosize.height;
Set the label height in the following method
-(UITableViewCell *) TableView: (UITableView *) TableView Cellforrowatindexpath: (Nsindexpath *) Indexpath
{
static NSString *detailcellidentifier = @ "Valuedetailcell";
static NSString *simplecellidentifier = @ "Valuedetailsimplecell";
NSLog (@ "section%d", indexpath.section);
Information with graphs
noticemessage* msg = [Arraynoticemessage objectAtIndex:indexPath.section];
Detailinfotableviewcell *cell = [TableView dequeuereusablecellwithidentifier:detailcellidentifier];
if (cell = = nil) {
cell = [[Detailinfotableviewcell alloc] Initwithstyle:uitableviewcellstyledefault reuseidentifier:d Etailcellidentifier];
}
Cell.contentView.layer.cornerRadius = 3;
Cell.contentView.layer.masksToBounds = YES;
Cell.contentView.layer.bounds = CGRectMake (0, 0, Cell.contentView.frame.size.width, CELL.CONTENTVIEW.FRAME.SIZE.HEIGHT-50);
Cell.contentView.backgroundColor = [Uicolor colorwithwhite:0.8 alpha:0.3];
Cell.InfoDate.text = msg.strdate;
Cell.InfoTitle.text = Msg.strtitle;
Cell.InfoContent.text = msg.strcontent;
Cell.InfoDate.text = Msg.strtimestamp;
Cell.backgroundcolor = [Uicolor Clearcolor];
Sets the height of the label;
Uifont *msgfont = [Uifont fontwithname:@ "Arial" size:15];
Cgsize infosize = [msg.strcontent sizewithfont:msgfont constrainedtosize:cgsizemake (MAXFLOAT) LineBreakMode: Uilinebreakmodewordwrap];
CGRect frame = cell.InfoContent.frame;
Frame.size.height = Infosize.height;
[Cell.infocontent Setframe:frame];
return cell;
}