UIRefreshControl和UITableView的backgroundVIew [英] UIRefreshControl and UITableView's backgroundVIew

查看:126
本文介绍了UIRefreshControl和UITableView的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 property。

This code goes where you set up your UITableViewController refreshControl property.

这篇关于UIRefreshControl和UITableView的backgroundVIew的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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