我不知道如何实现这个。我已经尝试了Stackoverflow上的所有方法,但是都没有生效。我有一个视图,在其下面有一张图片和一个tableView。但是tableView仍然是白色的。是否有人知道如何做到这一点?正如我所写的,从这里获取的方法都没用。
我想要这种UITableView:
导航栏也是我的问题之一(模糊和活力)。
在使用以下代码后:
我想要这种UITableView:
导航栏也是我的问题之一(模糊和活力)。
在使用以下代码后:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell:UITableViewCell = self.tableView.dequeueReusableCellWithIdentifier("cell") as UITableViewCell
let backgroundImageView = UIImageView(image: UIImage(named: "background3.png"))
cell.backgroundView = backgroundImageView
var visualEffectView = UIVisualEffectView(effect: UIBlurEffect(style: .Light)) as UIVisualEffectView
visualEffectView.frame = CGRectMake(0, 0, cell.bounds.width, cell.bounds.height)
backgroundImageView.addSubview(visualEffectView)
cell.textLabel?.text = self.field[indexPath.row]
cell.textLabel?.textColor = UIColor.whiteColor()
cell.textLabel?.backgroundColor = UIColor.clearColor()
return cell
}
我的tableView现在看起来像这样:
这很合理,因为这是background3.png图像的外观。