- (void)viewDidLoad {
}
在ios7 环境下 单独设置以上红色代码会报错 必须加上一下代码
//-------------------------------------------- 以下适应IOS 7 --------------------------------------------------------
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell =(UITableViewCell*)[selftableView:tableView cellForRowAtIndexPath:indexPath];
int a = [cell.contentViewsystemLayoutSizeFittingS
return a+1;
}
-(CGFloat)tableView:(UITableView *)tableViewestimatedHeightForRowAtI
{
return tableView.estimatedRowHeight;
}
//-------------------------------------------- 以上 适应IOS 7 --------------------------------------------------------
注意:在这只cell中元素的约束时不得将上下排列的左右元素全部设置高度,并且上下约束必须和cell关联
关注微信号,了解更多!