我有自定义表格视图。我已添加了4个视图
1.ImageView 2.三个标签
现在我希望该图像的大小应该会增加多个设备。因为我已经将它给予了约束.Proptional height 176:339
现在为了增加图像的高度,我增加了在代码下面使用的表的高度。
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if(!self.customCell)
{
self.customCell = [self.tableview dequeueReusableCellWithIdentifier:@"tableCell"];
}
CGFloat height;
height=self.customCell.img_main.frame.size.height;
height=height+self.customCell.label_one.frame.size.height;
height=height+self.customCell.label_two.frame.size.height;
height=height+self.customCell.label_three.frame.size.height;
height=height+self.customCell.dev_name.frame.size.height;
NSLog(@"height is %f",self.customCell.img_main.frame.size.height);
return height;
}
图像的高度总是176,我在4英寸屏幕的界面构建器中设置。
为什么两个图像的高度和表格视图单元格没有增加?