什么是UITableView separatorEffect属性? [英] What is UITableView separatorEffect property for?
问题描述
iOS 8中的新功能是 separatorEffect
属性,您可以为其分配UIVisualEffect。有没有人想出这是为了什么?我已经尝试了,我没有看到它有任何,呃,视觉效果。
New in iOS 8 is a separatorEffect
property, to which you are allowed to assign a UIVisualEffect. Has anyone figured out what this is for? I've tried it and I don't see it as having any, uh, visual effect.
推荐答案
我想知道完全相同的事情所以我为所有面临同样问题的人一起提出 Github 项目。
I was wondering the exact same thing so I put a Github project together for anyone facing the same issue.
基本思路是如果你的tableView的backgroundView包含带有模糊效果的 UIVisualEffectView
,那么设置 seperatorEffect
到具有与 UIVisualEffectView
相同模糊的鲜明效果将产生我们在通知中心看到的效果,其中分隔符看起来是透明的。
The basic idea is that if your tableView's backgroundView consists of a UIVisualEffectView
with a blur effect, then setting the seperatorEffect
to a Vibrant Effect with the same blur as the UIVisualEffectView
will produce the effect we see in Notification Center where the separators seem transparent.
这样的事情:
tableView.separatorEffect = UIVibrancyEffect(forBlurEffect: blurredBackgroundView.blurView.effect as UIBlurEffect)
将生成如下表格视图:
这篇关于什么是UITableView separatorEffect属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!