【发布时间】:2013-05-19 01:11:47
【问题描述】:
看看this video。
运行此代码时出现此故障:
[NSFetchedResultsController deleteCacheWithName:@"Root"];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"following == YES"];
[self.fetchedResultsController.fetchRequest setPredicate:predicate];
[self.fetchedResultsController performFetch:nil];
[self.tableView beginUpdates];
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:THE_SECTION_WITH_THE_BLOGS] withRowAnimation:UITableViewRowAnimationAutomatic];
[self.tableView endUpdates];
为什么我重新加载的部分下方的部分标题会像这样改变它的框架?有什么解决办法吗?
编辑:
这是我的视图ForHeaderInSection:
(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
if (tableView != self.tableView)
return nil;
BLMenuTableSectionHeaderView *view = nil;
if (section != BLMenuSectionUser) {
view = [[BLMenuTableSectionHeaderView alloc] initWithFrame:CGRectZero];
if (section == BLMenuSectionFollowing){
if ([self blogCount] > 0){
[view setTitle:NSLocalizedString(@"Following", nil)];
[view addSubview:self.editButton];
}else{
self.tableView.editing = NO;
}
}
if (section == BLMenuSectionPosts){
[view setTitle:NSLocalizedString(@"Browse", nil)];
}
else if (section == BLMenuSectionSettings)
[view setTitle:NSLocalizedString(@"Settings", nil)];
}
return view;
}
【问题讨论】:
-
你的 tableView: headerViewForSection: 实现怎么样?
-
您解决过这个问题吗?我看到了类似的东西。
标签: iphone ios objective-c uitableview