回答編集履歴
2
画像追加。
answer
CHANGED
@@ -1,13 +1,20 @@
|
|
1
|
+
# 前置き
|
1
2
|
UIToolBarは、(手前) BarTint > 半透明で白っぽいの > Background (奥)という感じの階層になっています。
|
2
3
|
|
3
|
-
|
4
|
+

|
4
5
|
|
6
|
+
緑がBarTint、そのすぐ後ろにあるのが「半透明の白っぽいの」(translucent)、ずっと後ろのオレンジがBackgroundです。(緑とオレンジは私が色を付けています)
|
7
|
+
|
8
|
+
# 回答
|
9
|
+
|
10
|
+
## その1: barTintColor
|
11
|
+
|
5
12
|
色を`myToolbar.barTintColor`で設定する。
|
6
13
|
(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Bar Tint**で設定する)
|
7
14
|
|
8
15
|
「その2」で書いているtranslucentはそのまま(true)です。
|
9
16
|
|
10
|
-
# その2 translucent
|
17
|
+
## その2 translucent
|
11
18
|
|
12
19
|
`myToolbar.translucent = false`とする。これで「半透明で白っぽいの」が無くなります。
|
13
20
|
(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Translucent**のチェックを外す)
|
1
補足。
answer
CHANGED
@@ -2,9 +2,14 @@
|
|
2
2
|
|
3
3
|
# その1: barTintColor
|
4
4
|
|
5
|
+
色を`myToolbar.barTintColor`で設定する。
|
5
|
-
|
6
|
+
(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Bar Tint**で設定する)
|
6
7
|
|
8
|
+
「その2」で書いているtranslucentはそのまま(true)です。
|
9
|
+
|
7
10
|
# その2 translucent
|
8
11
|
|
12
|
+
`myToolbar.translucent = false`とする。これで「半透明で白っぽいの」が無くなります。
|
9
|
-
|
13
|
+
(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Translucent**のチェックを外す)
|
14
|
+
|
10
|
-
|
15
|
+
色は今と同じく`myToolbar.backgroundColor`で設定する。
|