小编Kot*_*ora的帖子

UITableView上的模糊和活力效果

我只是不知道该怎么做.我已经尝试了Stackoverflow的所有功能,但没有任何效果.我有一个视图,图像和我的层次结构中的所有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
}
Run Code Online (Sandbox Code Playgroud)

我的tableView现在看起来像这样:

模拟器截图

这是合乎逻辑的,因为它是background3.png图像的外观.

ios swift alamofire

2
推荐指数
1
解决办法
4113
查看次数

标签 统计

alamofire ×1

ios ×1

swift ×1