在cellForRowAtIndexPath 方法返回cell之前,加上这一句 [cell layoutSubviews];
</pre></div><div><pre name="code" class="objc"> -(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"detailCell";
UITableViewCell *cell = [self.contactDetailTable dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier];
}
// 解决ios8 detailTextLabel 不显示问题
// if ([self checkOSVersion] >= 8) { // 判断当前系统版本。(其实不判断也没问题)
[cell layoutSubviews];
// }
return cell;
}