- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *LogCellId = @"LogCellId";
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:LogCellId];
UILabel *lblSummary;
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:LogCellId] autorelease];
lblSummary = [[[UILabel alloc] initWithFrame:CGRectMake(10.0, 10.0, 320.0, 30.0)] autorelease];
lblSummary.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
lblSummary.tag = SUMMARY_TAG;
lblSummary.lineBreakMode = UILineBreakModeTailTruncation;
lblSummary.autoresizingMask = UIViewAutoresizingFlexibleRightMargin;
[cell.contentView addSubview:lblSummary];
} else {
lblSummary = (UILabel *)[cell viewWithTag:SUMMARY_TAG];
}
lblSummary.text = [self.logList objectAtIndex:[indexPath row]];
return cell;
}
我在那里只是一个简单的单元格与一个标签。我添加了滑动删除功能,但删除按钮与标签重叠,而不是将其推到一边。在UITableView删除确认按钮重叠的内容
所以我需要帮助。我希望能够回答我将如何做到这一点以及自动调整口罩如何工作。我根本不满意他们,无论何时何地使用自动调整子视图。
谢谢你的时间。
我问这个问题,3个月前,没有有用的答案:http://stackoverflow.com/questions/4390583/resize-uitableviewcell-content-when-delete-button-shows-up。 – GendoIkari 2011-03-28 16:06:57
@GendoIkari我找到了一个解决方案,并已回复你的问题。 – rein 2012-03-05 00:55:15