回答編集履歴
2
Color
test
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
|
31
31
|
if let cell = collectionView.cellForItem(at: indexPath) {
|
32
32
|
|
33
|
-
cell.contentView.background = .red
|
33
|
+
cell.contentView.backgroundColor = .red
|
34
34
|
|
35
35
|
}
|
36
36
|
|
1
cellForItem(at:)
test
CHANGED
@@ -15,3 +15,23 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
あとは、「セルの再利用」について調べて下さい。
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
# セルの取得
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
セルの取得方法が間違っています。
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
```swift
|
30
|
+
|
31
|
+
if let cell = collectionView.cellForItem(at: indexPath) {
|
32
|
+
|
33
|
+
cell.contentView.background = .red
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
```
|