回答編集履歴
9
訂正
answer
CHANGED
@@ -21,6 +21,6 @@
|
|
21
21
|
self.Segment.tintColor = UIColor.clear
|
22
22
|
self.Segment.backgroundColor = UIColor(red: 255/255, green: 49/255, blue: 81/255, alpha: 1)
|
23
23
|
let attribute = [kCTForegroundColorAttributeName:UIColor.white]
|
24
|
-
self.
|
24
|
+
self.setTitleTextAttributes(attribute, for: .normal)
|
25
25
|
}
|
26
26
|
```
|
8
訂正
answer
CHANGED
@@ -14,7 +14,8 @@
|
|
14
14
|
ティントカラーとかだから、ここでいいのかな?
|
15
15
|
|
16
16
|
####貼り付けてほしいコード
|
17
|
-
↓これを貼るとどんなエラーが出ますか?
|
17
|
+
↓これを貼るとどんなエラーが出ますか? 色が変わらないだけで、エラーは出ないと思いますが。
|
18
|
+
タイプミスがあったらごめんなさい。
|
18
19
|
```swift
|
19
20
|
@IBAction func Segment(_ sender: UISegmentedControl) {
|
20
21
|
self.Segment.tintColor = UIColor.clear
|
7
コード追加
answer
CHANGED
@@ -11,4 +11,15 @@
|
|
11
11
|
~~SegmentedControlの初期プロパティの設定を変更するのでしたら、
|
12
12
|
違う場所、ViewControllerのviewDidLoadとかライフサイクル的に適切な場所に書いてあげてください。
|
13
13
|
~~
|
14
|
-
ティントカラーとかだから、ここでいいのかな?
|
14
|
+
ティントカラーとかだから、ここでいいのかな?
|
15
|
+
|
16
|
+
####貼り付けてほしいコード
|
17
|
+
↓これを貼るとどんなエラーが出ますか? タイプミスがあったらごめんなさい。
|
18
|
+
```swift
|
19
|
+
@IBAction func Segment(_ sender: UISegmentedControl) {
|
20
|
+
self.Segment.tintColor = UIColor.clear
|
21
|
+
self.Segment.backgroundColor = UIColor(red: 255/255, green: 49/255, blue: 81/255, alpha: 1)
|
22
|
+
let attribute = [kCTForegroundColorAttributeName:UIColor.white]
|
23
|
+
self.Segment.setTitleTextAttributes(attribute, forState: .Normal)
|
24
|
+
}
|
25
|
+
```
|
6
訂正
answer
CHANGED
@@ -8,5 +8,7 @@
|
|
8
8
|
```
|
9
9
|
####見落としていたので追記します。
|
10
10
|
|
11
|
-
|
11
|
+
~~SegmentedControlの初期プロパティの設定を変更するのでしたら、
|
12
|
-
違う場所、ViewControllerのviewDidLoadとかライフサイクル的に適切な場所に書いてあげてください。
|
12
|
+
違う場所、ViewControllerのviewDidLoadとかライフサイクル的に適切な場所に書いてあげてください。
|
13
|
+
~~
|
14
|
+
ティントカラーとかだから、ここでいいのかな?
|
5
誤字訂正
answer
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
黄色の警告からの想像ですが、つくってあげたattributeをどこかでつかってあげてますか?
|
2
|
-
↓の3行目
|
2
|
+
↓の3行目に該当する部分。
|
3
3
|
|
4
4
|
```swift
|
5
5
|
let attribute = [kCTForegroundColorAttributeName:UIColor.white]
|
4
訂正
answer
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
黄色の警告からの想像ですが、つくってあげたattributeをどこかでつかってあげてますか?
|
2
|
-
↓の
|
2
|
+
↓の3行目の部分に該当する部分。
|
3
3
|
|
4
4
|
```swift
|
5
5
|
let attribute = [kCTForegroundColorAttributeName:UIColor.white]
|
3
追記
answer
CHANGED
@@ -5,4 +5,8 @@
|
|
5
5
|
let attribute = [kCTForegroundColorAttributeName:UIColor.white]
|
6
6
|
// ↓この記述がないんじゃない?
|
7
7
|
Outlet接続したセグメンテッドコントロール.setTitleTextAttributes(attribute, forState: .Normal)
|
8
|
-
```
|
8
|
+
```
|
9
|
+
####見落としていたので追記します。
|
10
|
+
|
11
|
+
それとSegmentedControlの初期プロパティの設定が@IBAction/アクション接続の中に書かれているので、
|
12
|
+
違う場所、ViewControllerのviewDidLoadとかライフサイクル的に適切な場所に書いてあげてください。
|
2
修正
answer
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
↓の2行目の部分に該当する部分。
|
3
3
|
|
4
4
|
```swift
|
5
|
-
let attribute = [
|
5
|
+
let attribute = [kCTForegroundColorAttributeName:UIColor.white]
|
6
6
|
// ↓この記述がないんじゃない?
|
7
|
-
|
7
|
+
Outlet接続したセグメンテッドコントロール.setTitleTextAttributes(attribute, forState: .Normal)
|
8
8
|
```
|
1
修正
answer
CHANGED
File without changes
|