gpt4 book ai didi

ios - UITableView 自定义拉动刷新 View 不显示

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:14:14 24 4
gpt4 key购买 nike

我有以下代码用于我的自定义下拉刷新。

CGFloat customRefreshControlHeight = 50.0f;
CGFloat customRefreshControlWidth = 320.0f;
CGRect customRefreshControlFrame = CGRectMake(0.0f,
-customRefreshControlHeight,
customRefreshControlWidth,
customRefreshControlHeight);

TestRefreshView *refreshView = [[TestRefreshView alloc] init];
refreshView.frame = customRefreshControlFrame;
self.testRefreshView = refreshView;

[self.tableView addSubview: self.testRefreshView];

但是,当我拉下我的 table 时,这个 View 并没有出现。还有什么我需要设置但我遗漏的吗?

最佳答案

这是我在 UIrefreshController 中使用自定义 UIView 的工作示例:

self.refreshControl = [[UIRefreshControl alloc] init];
self.refreshControl.frame = CGRectMake(x,
y,
self.refreshControl.bounds.size.width,
self.refreshControl.bounds.size.height);

self.animIndView = [[AnimatorIndicatorView alloc] initWithFrame:self.refreshControl.frame];


[self.refreshControl addTarget:controller action:@selector(refrechLocation:) forControlEvents:UIControlEventValueChanged];
[self.refreshControl setTintColor:[UIColor clearColor]];

[controller.refreshControl addSubview:self.animIndView];

[self.tableView addSubview:self.refreshControl];

关于ios - UITableView 自定义拉动刷新 View 不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31346710/

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