gpt4 book ai didi

ios - 如何在 TableView 自定义期间调用方法 "willDisplayFooterView"?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:43:57 25 4
gpt4 key购买 nike

我想调用这些方法:

- (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);

可是我做不到!一点 react 都没有。我在模拟器 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];
}

其他委托(delegate)方法工作正常!

最佳答案

您不会调用这些方法。 TableView 将调用您对这些方法的实现(如果它们存在),让您知道它即将显示页眉或页脚 View 。

这些是您提供的可选方法。 TableView 不提供它们。

关于ios - 如何在 TableView 自定义期间调用方法 "willDisplayFooterView"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13392938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com