简单实现了一个UITableView,如下图
想要做一个点击cell行能够展开详情功能
报了:sizeWithFont:constrainedToSize:lineBreakMode:' is deprecated,现在得用成:boudingRectWithSize:options:attributes:context,示例:
NSDictionary *attribute = @{NSFontAttributeName: [UIFont systemFontOfSize:13]};
CGSize size = [@“相关NSString” boundingRectWithSize:CGSizeMake(100, 0) options: NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:attribute context:nil].size;
还可以对cell进行一些美化设置:
cell.selectedBackgroundV