UIRefreshControl和UITableView的背景视图 [英] UIRefreshControl and UITableView's backgroundVIew
问题描述
我有一个UITableViewController,在上面设置了backgroundView.该控制器已安装UIRefreshControl.问题是,当我设置背景视图时,刷新控件是不可见的.如果删除背景视图,则可以看到刷新控件.
I have a UITableViewController on which I set a backgroundView. This controller has a UIRefreshControl installed. The problem is that when I set a background view, the refresh control is invisible. If I remove the background view, I can see the refresh control.
我做错什么了吗?
推荐答案
此行为的原因是,在iOS 7中,UITableView
的backgroundView
绘制在UIRefreshControl
上方.不知道这是设计使然还是问题,但是这里有一种变通办法可以为我解决此问题:
The reason for this behavior is that in iOS 7, the UITableView
's backgroundView
is drawn above the UIRefreshControl
. Not sure if this is by design or an issue, but here is a workaround that fixed it for me :
self.tableView.backgroundView.layer.zPosition -= 1;
此代码可用于设置UITableViewController refreshControl
属性的位置.
This code goes where you set up your UITableViewController refreshControl
property.
这篇关于UIRefreshControl和UITableView的背景视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!