tableview 背景空白点击
2017-09-07 本文已影响0人
0o简单o0
UIGestureRecognizerDelegate
let tag = UITapGestureRecognizer.init(target: self, action: #selector(ChangeGoodsNormsVC.test))
tag.delegate = self
self.tableView.addGestureRecognizer(tag)
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool {
if (touch.view?.isKind(of: UITableView.self))! {
return true
}
else
{
return false
}
}
处理透明读度
self.View?.backgroundColor = UIColor.black.withAlphaComponent(0.3)
//tableview必须双清
self.tableView.backgroundColor = UIColor.clear
self.tableView.backgroundView?.backgroundColor = UIColor.clear