From e89c62cab60768b95d1c25cd5f1a3583eee20501 Mon Sep 17 00:00:00 2001 From: miniLV Date: Thu, 20 Sep 2018 14:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20-=20iOS11=20-=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E9=80=82=E9=85=8D(=E8=A7=A3=E5=86=B3=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8F=B0=20-=20`LayoutConstraints=20`=20=E8=BE=93?= =?UTF-8?q?=E5=87=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Classes/UITableView+FDTemplateLayoutCell.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Classes/UITableView+FDTemplateLayoutCell.m b/Classes/UITableView+FDTemplateLayoutCell.m index 632b32c..11a8b09 100644 --- a/Classes/UITableView+FDTemplateLayoutCell.m +++ b/Classes/UITableView+FDTemplateLayoutCell.m @@ -158,7 +158,10 @@ - (__kindof UITableViewCell *)fd_templateCellForReuseIdentifier:(NSString *)iden templateCell = [self dequeueReusableCellWithIdentifier:identifier]; NSAssert(templateCell != nil, @"Cell must be registered to table view for identifier - %@", identifier); templateCell.fd_isTemplateLayoutCell = YES; - templateCell.contentView.translatesAutoresizingMaskIntoConstraints = NO; + NSString *version = [UIDevice currentDevice].systemVersion; + if (version.doubleValue < 11.0){ + templateCell.contentView.translatesAutoresizingMaskIntoConstraints = NO; + } templateCellsByIdentifiers[identifier] = templateCell; [self fd_debugLog:[NSString stringWithFormat:@"layout cell created - %@", identifier]]; }