Saturday, June 8, 2013

UITableView tableView willDisplayFooterView forSection example in Objective C (iOS).


UITableView tableView willDisplayFooterView forSection

Tells the delegate that a footer view is about to be displayed for the specified section.

- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section

Parameters of [UITableView tableView willDisplayFooterView forSection]
tableView
The table-view object informing the delegate of this event.
view
The footer view that is about to be displayed.
section
An index number identifying a section of tableView .

UITableView tableView willDisplayFooterView forSection example.
- (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];
}

End of UITableView tableView willDisplayFooterView forSection example article.