小编Boš*_*tar的帖子

如何在静态表 Swift Xcode 6 中设置单元格的背景颜色

我有静态表,我设置了背景颜色tableview -> tableView.backgroundColor = UIColor.redColor(),当我有等时。静态表中有 3 行然后是 tableview 颜色,3 行是白色如何修复此单元格的背景颜色?此代码不适用于静态表 ->

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! UITableViewCell


    cell.textLabel!.text = numbers[indexPath.row]
    cell.backgroundColor = UIColor.greenColor()

    return cell
}
Run Code Online (Sandbox Code Playgroud)

static tableview ios8 xcode6.1

3
推荐指数
1
解决办法
8357
查看次数

标签 统计

ios8 ×1

static ×1

tableview ×1

xcode6.1 ×1