iPhone 拉动以刷新移动图标位置

标签 iphone objective-c ios uiscrollview uirefreshcontrol

我的 ScrollView 横跨 iPhone 的整个高度。因此,iPhone 的半透明状态栏覆盖在 ScrollView 的顶部。我已将 iOS6 的 UIRefreshControl 添加到 ScrollView ,如下所示:

UIRefreshControl *pullToRefresh = [[UIRefreshControl alloc] init];
[pullToRefresh addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
self.refreshControl = pullToRefresh;
[self.scrollView addSubview:refreshControl];

一切功能都运行良好。然而,下拉刷新图标并没有拉低到足以清除 iPhone 状态栏的程度。这看起来很垃圾,就像这样:

Pull to Refresh

我尝试在 UIRefreshControl 上设置框架/边界来重新定位刷新图标,但没有成功。任何想法将不胜感激!

最佳答案

尝试在顶部设置 20 像素的 contentInset。这是 UIScrollView 上的一个属性。

关于iPhone 拉动以刷新移动图标位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13342119/

相关文章:

iphone - 如何在UIWebView中嵌入本 map 片?

iphone - -[NSConcreteMutableData _isResizable] : issue with UIImage

iphone - UITableView "bounce area"中的浅灰色背景

iphone - CALayer setNeedsDisplayInRect - InRect 的意义是什么?或者在drawInContext中更快地绘制

ios - 如何禁用特定 UITableViewCell 的图像?

ios - 我进行更改后陷入欢迎使用 Xamarin Forms 状态

javascript - phonegap db 查询插入/选择语法

ios - 为什么 GCDAsyncSocket 总是在读取超时后断开连接?

objective-c - 如何让 NSButton 位于 NSButton 之上?

ios - SFSafariViewController - 从网页与父应用程序交互