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.
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.
If you set youBar.clipsToBounds = YES, the hairline disappear.
Hope this help.
[EDIT]
For the navigationBar bottom hairline, the solution here https://stackoverflow.com/a/18180330/2011578 also works great.
The hairline border is a UIImageView subview of the toolbar, you can hide it like this:
for (UIView *subView in [self.toolbar subviews]) { if ([subView isKindOfClass:[UIImageView class]]) { // Hide the hairline border subView.hidden = YES; } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With