Autolayout为UITableViewCell for iOS 7和iOS 8中的内容设置最小高度

时间:2015-07-28 11:18:35

标签: uitableview autolayout

我创建UITableViewCell,其中包含两个UILabels标题和副标题。此UITableViewCell具有动态高度。当标题和副标题有一行时,我希望UITableViewCell高度等于44.0。但我得到的更少。

代码:

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
    [self.labelTitle autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(6.0, 16.0, 6.0, 8.0) excludingEdge:ALEdgeBottom];
    [self.labelDetailedTitle autoPinEdgesToSuperviewEdgesWithInsets:UIEdgeInsetsMake(6.0, 16.0, 6.0, 8.0) excludingEdge:ALEdgeTop];
    [self.labelTitle autoPinEdge:ALEdgeBottom toEdge:ALEdgeTop ofView:self.labelDetailedTitle];
return self;

}

是否有可能为UITableViewCell内容设置最小高度?

0 个答案:

没有答案