我想改變tablecell的背景顏色。 這裏是代碼:自定義UITableViewCell背景顏色
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("FirstMainViewTableCells") as! FirstMainViewTableCell
cell.backgroundColor = UIColor(red: 43, green: 65, blue: 87, alpha: 1)
return cell
}
這裏是結果:
但它與UIColor.blackColor()和作品的UIColor。顏色:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("FirstMainViewTableCells") as! FirstMainViewTableCell
cell.backgroundColor = UIColor.blackColor()
return cell
}
你能幫助我嗎?
我得到403錯誤頁面,不能查看您的保管箱。 –
@ Dato'MohammadNurdin我們甚至不需要鏈接,它明顯的背景是黑色的。 – Arbitur