Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing the white space between UITableView and UIRefreshControl when dragging

Tags:

xcode

ios

swift

I have a table view with UIRefreshControl.

The first row of the table is Blue and the UIRefreshControl background color is blue too.

when I drag the table down in order to refresh it I got a this white line separating the table and UIRefreshControl.

This line is disappearing when i stop dragging the table.

How can I remove this white line without changing the tableview background color which is white?

Image attached for clarification: Snapshot

like image 439
Zuhair Ali Avatar asked Jan 29 '15 07:01

Zuhair Ali


1 Answers

Similar to Jing's answer, I made a gap-cover view and introduced it behind the refresh control. I didn't need to do any scroll-time adjustments since the negative y-position was sufficient.

let gapCoverView = UIView(frame: CGRect(x: 0, y: -200, width: self.view.frame.width, height: 250))
gapCoverView.backgroundColor = UIColor.red
self.view.insertSubview(gapCoverView, belowSubview: refreshControl!)
like image 162
Albert Bori Avatar answered Nov 11 '22 14:11

Albert Bori