UIRefreshControl和UITableView的背景视图 [英] UIRefreshControl and UITableView's backgroundVIew

查看:66
本文介绍了UIRefreshControl和UITableView的背景视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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中,UITableViewbackgroundView绘制在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆