我想调用这些方法:
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0);
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section NS_AVAILABLE_IOS(6_0);
但我不能!完全没有反应。我正在模拟器 iOS 6.0 上进行测试
- (void) tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
DLog(@"0>>");
CGRect originalRect = view.frame;
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"shadow_top.png"]];
[imageView setFrame:CGRectMake(0.0f, originalRect.size.height - imageView.frame.size.height, imageView.frame.size.width, imageView.frame.size.height)];
[view addSubview:imageView];
}
- (void) tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section
{
DLog(@"0>f>");
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"shadow_bottom.png"]];
[imageView setFrame:CGRectMake(0.0f, 0.0f, imageView.frame.size.width, imageView.frame.size.height)];
[view addSubview:imageView];
}
其他委托方法工作正常!