teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

画像追加。

2016/11/24 07:16

投稿

fuzzball
fuzzball

スコア16733

answer CHANGED
@@ -1,13 +1,20 @@
1
+ # 前置き
1
2
  UIToolBarは、(手前) BarTint > 半透明で白っぽいの > Background (奥)という感じの階層になっています。
2
3
 
3
- # その1: barTintColor
4
+ ![Hierarchy](030e6a31e1564aefb99c4483f0e3b042.png)
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

補足。

2016/11/24 07:16

投稿

fuzzball
fuzzball

スコア16733

answer CHANGED
@@ -2,9 +2,14 @@
2
2
 
3
3
  # その1: barTintColor
4
4
 
5
+ 色を`myToolbar.barTintColor`で設定する。
5
- * 色は`myToolbar.barTintColor`で設定する。(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Bar Tint**で設定する)
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
- * `myToolbar.translucent = false`とする。これで「半透明で白っぽいの」が無くなります。(Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Translucent**のチェックを外す)
13
+ (Storyboardの場合は、Attributes inspectorのToolbarの項目にある**Translucent**のチェックを外す)
14
+
10
- * 色は今と同じく`myToolbar.backgroundColor`で設定する。
15
+ 色は今と同じく`myToolbar.backgroundColor`で設定する。