teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2016/12/08 12:32

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -3,6 +3,6 @@
3
3
  ```swift
4
4
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
5
5
  // cell 作成
6
- cell.contentView.backgroundColor = UIColor.gray
6
+ cell.contentView.backgroundColor = UIColor.lightGray
7
7
  }
8
8
  ```

1

修正

2016/12/08 12:32

投稿

_Kentarou
_Kentarou

スコア8490

answer CHANGED
@@ -1,8 +1,8 @@
1
- 以下試してみてください。
1
+ `cell`には`contentView`という`UIView`が乗っているのでそれの背景色変えてみてください。
2
2
 
3
3
  ```swift
4
4
  func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
5
- // cell 作成
5
+ // cell 作成
6
- cell.contentView.backgroundColor = UIColor.gray
6
+ cell.contentView.backgroundColor = UIColor.gray
7
- }
7
+ }
8
8
  ```