DGElasticPullToRefresh
DGElasticPullToRefresh copied to clipboard
Faint line between DGElasticPullToRefresh and Nav Bar
When i pull to refresh, i see a faint line, probably the Nav Bar's border line. While on your display view example, there isn't any line separating the DGElasticPullToRefresh from the Navigation Bar. Thanks in advance :)
@MartinQue ever solved this? I have the same
@gunnarblom haven't solved it yet. Any luck on your side?
@MartinQue Yep, add this in viewDidLoad or similar before setting up the pull to refresh:
let view = UIView()
view.backgroundColor = self.navigationController!.navigationBar.barTintColor
var rect = view.frame
rect.origin.x = 0
rect.origin.y = self.navigationController!.navigationBar.frame.size.height
rect.size.width = self.navigationController!.navigationBar.frame.size.width
rect.size.height = 1
view.frame = rect
self.navigationController!.navigationBar.addSubview(view)
Works perfect
Another solution, in viewDidLoad()
set navigationBar.clipsToBounds = true
.
You can remove that shadow completely from your app with:
UINavigationBar.appearance().shadowImage = UIImage()
Just add it to your AppDelegate file:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
UINavigationBar.appearance().shadowImage = UIImage()
return true
}
Neither...
UINavigationBar.appearance().shadowImage = UIImage()
or
navigationBar.clipsToBounds = true
...works for me. Only the addSubview() method I posted above.