问题描述
在iOS 7中,Apple已更改 UIToolbar
以在其顶部显示1px的发际线。在某些情况下,这在视觉上会分散注意力,并且似乎没有任何公共API可以删除它。
In iOS 7, Apple has changed UIToolbar
to display a 1px hairline at its top. This is visually distracting in some cases, and there does not seem to be any public API to remove it.
设置shadowImage不起作用。
Setting a shadowImage does not work.
我正在寻找一种以相对干净的方式去除发际线的方法,并保持普通的背景模糊。
I am looking for a way of removing the hairline in a relatively clean way, and keep the ordinary background blur.
推荐答案
如果设置youBar.clipsToBounds = YES,则发际线消失。
If you set youBar.clipsToBounds = YES, the hairline disappear.
希望此帮助。
对于navigationBar底部发际线,这里的解决方案也很有效。
For the navigationBar bottom hairline, the solution here https://stackoverflow.com/a/18180330/2011578 also works great.
这篇关于在iOS 7中删除UIToolbar发际线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!