回答編集履歴

2

画像追加。

2016/11/24 07:16

投稿

fuzzball
fuzzball

スコア16731

test CHANGED
@@ -1,8 +1,22 @@
1
+ # 前置き
2
+
1
3
  UIToolBarは、(手前) BarTint > 半透明で白っぽいの > Background (奥)という感じの階層になっています。
2
4
 
3
5
 
4
6
 
7
+ ![Hierarchy](030e6a31e1564aefb99c4483f0e3b042.png)
8
+
9
+
10
+
11
+ 緑がBarTint、そのすぐ後ろにあるのが「半透明の白っぽいの」(translucent)、ずっと後ろのオレンジがBackgroundです。(緑とオレンジは私が色を付けています)
12
+
13
+
14
+
15
+ # 回答
16
+
17
+
18
+
5
- # その1: barTintColor
19
+ ## その1: barTintColor
6
20
 
7
21
 
8
22
 
@@ -16,7 +30,7 @@
16
30
 
17
31
 
18
32
 
19
- # その2 translucent
33
+ ## その2 translucent
20
34
 
21
35
 
22
36
 

1

補足。

2016/11/24 07:16

投稿

fuzzball
fuzzball

スコア16731

test CHANGED
@@ -6,7 +6,13 @@
6
6
 
7
7
 
8
8
 
9
+ 色を`myToolbar.barTintColor`で設定する。
10
+
9
- * 色は`myToolbar.barTintColor`で設定する。(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Bar Tint**で設定する)
11
+ (Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Bar Tint**で設定する)
12
+
13
+
14
+
15
+ 「その2」で書いているtranslucentはそのまま(true)です。
10
16
 
11
17
 
12
18
 
@@ -14,6 +20,12 @@
14
20
 
15
21
 
16
22
 
17
- * `myToolbar.translucent = false`とする。これで「半透明で白っぽいの」が無くなります。(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Translucent**のチェックを外す)
23
+ `myToolbar.translucent = false`とする。これで「半透明で白っぽいの」が無くなります。
18
24
 
25
+ (Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Translucent**のチェックを外す)
26
+
27
+
28
+
19
- * 色は今と同じく`myToolbar.backgroundColor`で設定する。
29
+ 色は今と同じく`myToolbar.backgroundColor`で設定する。
30
+
31
+