I'm using UITableView in a swift application, and using my own custom UITableViewCell.
When trying to hide the empty cells in the UITableView, its still have the white background.
Under the UITableView I have a background image (UImageView).
I'v already try to hide those cells, and actually they are hidden, but I still have a white background, using this code:
override func viewDidLoad() { super.viewDidLoad() var tblView = UIView(frame: CGRect(x: 0,y: 0,width: 0,height: 0)) tblView.backgroundColor = UIColor.clearColor() tableView.tableFooterView = tblView var nipName=UINib(nibName: "CustomCell", bundle:nil) self.tableView.registerNib(nipName, forCellReuseIdentifier: "CustomCell") }
A cleaner solution is:
tableView.tableFooterView = UIView(frame: CGRectZero)
Nothing else is needed.
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