@property (nonatomic) CGFloat rowHeight; // default is UITableViewAutomaticDimension @property (nonatomic) CGFloat sectionHeaderHeight; // default is UITableViewAutomaticDimension @property (nonatomic) CGFloat sectionFooterHeight; // default is UITableViewAutomaticDimension @property (nonatomic) CGFloat estimatedRowHeight NS_AVAILABLE_IOS(7_0); // default is UITableViewAutomaticDimension, set to 0 to disable @property (nonatomic) CGFloat estimatedSectionHeaderHeight NS_AVAILABLE_IOS(7_0); // default is UITableViewAutomaticDimension, set to 0 to disable @property (nonatomic) CGFloat estimatedSectionFooterHeight NS_AVAILABLE_IOS(7_0); // default is UITableViewAutomaticDimension, set to 0 to disable
使用:atom
一、cell自適應高度code
self.myTableView.estimatedRowHeight = 70;
self.myTableView.rowHeight = UITableViewAutomaticDimension;io
二、其餘同理class