ios7之后UITableViewCell背景无法设置透明了,所以无法看到tableview之下UIImageView上的图片,所以只写这样的代码无效
var imageView = UIImageView(image: UIImage(named: "background.jpeg"))
self.view.addSubview(imageView)
self.tableView = UITableView(frame: self.view!.frame)
self.tableView.delegate = self
self.tableView.dataSource = self
self.tableView.backgroundColor = UIColor.clearColor()
self.view.addSubview(self.tableView)
所以要实现UITableViewDelegate中的方法
func tableView(tableView: UITableView!, willDisplayCell cell: UITableViewCell!, forRowAtIndexPath indexPath: NSIndexPath!)
{cell.backgroundColor = UIColor.clearColor()}
即可实现这样的效果