【发布时间】:2015-05-12 13:11:07
【问题描述】:
我只是不知道该怎么做。我已经尝试了 Stackoverflow 中的所有内容,但没有任何效果。在我的层次结构中,我有一个视图、图像和所有 tableView 下方。但是表视图仍然是白色的。有没有人知道如何做到这一点?正如我所写,这里没有任何效果。
我想要这样的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 图像的外观。
【问题讨论】:
-
我已经厌倦了在没有给出理由或名字的情况下拒绝投票问题的懦夫。这个问题没有错。