回答編集履歴

9

訂正

2018/08/25 17:11

投稿

退会済みユーザー
test CHANGED
@@ -44,7 +44,7 @@
44
44
 
45
45
  let attribute = [kCTForegroundColorAttributeName:UIColor.white]
46
46
 
47
- self.Segment.setTitleTextAttributes(attribute, forState: .Normal)
47
+ self.setTitleTextAttributes(attribute, for: .normal)
48
48
 
49
49
  }
50
50
 

8

訂正

2018/08/25 17:11

投稿

退会済みユーザー
test CHANGED
@@ -30,7 +30,9 @@
30
30
 
31
31
  ####貼り付けてほしいコード
32
32
 
33
- ↓これを貼るとどんなエラーが出ますか? タイプミスあったごめんい。
33
+ ↓これを貼るとどんなエラーが出ますか? 変わらないだけで、エラーは出ないと思いますが
34
+
35
+ タイプミスがあったらごめんなさい。
34
36
 
35
37
  ```swift
36
38
 

7

コード追加

2018/08/25 17:07

投稿

退会済みユーザー
test CHANGED
@@ -25,3 +25,25 @@
25
25
  ~~
26
26
 
27
27
  ティントカラーとかだから、ここでいいのかな?
28
+
29
+
30
+
31
+ ####貼り付けてほしいコード
32
+
33
+ ↓これを貼るとどんなエラーが出ますか? タイプミスがあったらごめんなさい。
34
+
35
+ ```swift
36
+
37
+ @IBAction func Segment(_ sender: UISegmentedControl) {
38
+
39
+ self.Segment.tintColor = UIColor.clear
40
+
41
+ self.Segment.backgroundColor = UIColor(red: 255/255, green: 49/255, blue: 81/255, alpha: 1)
42
+
43
+ let attribute = [kCTForegroundColorAttributeName:UIColor.white]
44
+
45
+ self.Segment.setTitleTextAttributes(attribute, forState: .Normal)
46
+
47
+ }
48
+
49
+ ```

6

訂正

2018/08/25 17:01

投稿

退会済みユーザー
test CHANGED
@@ -18,6 +18,10 @@
18
18
 
19
19
 
20
20
 
21
- それとSegmentedControlの初期プロパティの設定が@IBAction/アクション接続の中に書かれているので、
21
+ ~~SegmentedControlの初期プロパティの設定を変更するのでしたら
22
22
 
23
23
  違う場所、ViewControllerのviewDidLoadとかライフサイクル的に適切な場所に書いてあげてください。
24
+
25
+ ~~
26
+
27
+ ティントカラーとかだから、ここでいいのかな?

5

誤字訂正

2018/08/25 14:23

投稿

退会済みユーザー
test CHANGED
@@ -1,6 +1,6 @@
1
1
  黄色の警告からの想像ですが、つくってあげたattributeをどこかでつかってあげてますか?
2
2
 
3
- ↓の3行目の部分に該当する部分。
3
+ ↓の3行目に該当する部分。
4
4
 
5
5
 
6
6
 

4

訂正

2018/08/25 13:44

投稿

退会済みユーザー
test CHANGED
@@ -1,6 +1,6 @@
1
1
  黄色の警告からの想像ですが、つくってあげたattributeをどこかでつかってあげてますか?
2
2
 
3
- ↓の2行目の部分に該当する部分。
3
+ ↓の3行目の部分に該当する部分。
4
4
 
5
5
 
6
6
 

3

追記

2018/08/25 13:43

投稿

退会済みユーザー
test CHANGED
@@ -13,3 +13,11 @@
13
13
  Outlet接続したセグメンテッドコントロール.setTitleTextAttributes(attribute, forState: .Normal)
14
14
 
15
15
  ```
16
+
17
+ ####見落としていたので追記します。
18
+
19
+
20
+
21
+ それとSegmentedControlの初期プロパティの設定が@IBAction/アクション接続の中に書かれているので、
22
+
23
+ 違う場所、ViewControllerのviewDidLoadとかライフサイクル的に適切な場所に書いてあげてください。

2

修正

2018/08/25 13:09

投稿

退会済みユーザー
test CHANGED
@@ -6,10 +6,10 @@
6
6
 
7
7
  ```swift
8
8
 
9
- let attribute = [NSForegroundColorAttributeName:UIColor.whiteColor()]
9
+ let attribute = [kCTForegroundColorAttributeName:UIColor.white]
10
10
 
11
11
  // ↓この記述がないんじゃない?
12
12
 
13
- imasSegmentedControl.setTitleTextAttributes(attribute, forState: .Normal)
13
+ Outlet接続したセグメンテッドコントロール.setTitleTextAttributes(attribute, forState: .Normal)
14
14
 
15
15
  ```

1

修正

2018/08/25 10:09

投稿

退会済みユーザー
test CHANGED
File without changes