我的 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 状态栏的程度。这看起来很垃圾,就像这样:
我尝试在 UIRefreshControl 上设置框架/边界来重新定位刷新图标,但没有成功。任何想法将不胜感激!
最佳答案
尝试在顶部设置 20 像素的 contentInset。这是 UIScrollView 上的一个属性。
关于iPhone 拉动以刷新移动图标位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13342119/