iOS UIRefreshControl add margin fix

why

if set UIRefreshControl attributedTitle before refresh the control there will be a top margin

fix

method 1

assign refreshControl after set attributedTitle

var refreshControl = UIRefreshControl()
refreshControl.attributedTitle = NSAttributedString(string: "Last:", attributes: [NSForegroundColorAttributeName: UIColor.whiteColor()])
self.refreshControl = refreshControl

method 2

set attributedTitle in refresh callback



blog comments powered by Disqus

Published

07 August 2014

Category

ios

Tags