【发布时间】:2014-09-04 19:15:20
【问题描述】:
我正在使用 UITableView 和 UIRefreshControl 开发 iOS 应用程序。
我想将 UIRefreshControl 指示器的初始位置从默认值下调 50px。我写下以下代码。
但是,初始位置没有改变。它保持在原来的位置。
你能告诉我如何解决这个问题吗?
CGFloat customRefreshControlHeight = 50.0f;
CGFloat customRefreshControlWidth = 320.0f;
CGRect customRefreshControlFrame = CGRectMake(0.0f,
customRefreshControlHeight,
customRefreshControlWidth,
customRefreshControlHeight);
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] initWithFrame:customRefreshControlFrame];
refreshControl.tintColor = [UIColor blackColor];
[refreshControl addTarget:self action:@selector(onRefresh:) forControlEvents:UIControlEventValueChanged];
[self.tableView addSubview:refreshControl];
【问题讨论】:
-
我想你可以在这里找到正确的答案:stackoverflow.com/a/59489992/6869609
标签: ios uitableview uirefreshcontrol