質問編集履歴

2

情報追加

2020/08/12 09:42

投稿

ludolf
ludolf

スコア39

test CHANGED
File without changes
test CHANGED
@@ -161,3 +161,25 @@
161
161
 
162
162
 
163
163
  よろしくお願いします!
164
+
165
+
166
+
167
+
168
+
169
+ ### 追記
170
+
171
+
172
+
173
+ ![イメージ説明](a9a74d980f4817538715b53d16048a01.png)
174
+
175
+
176
+
177
+ ずっと黒・グレイでitemが表示されていたので、tintColorが悪さしてるんじゃないかと思って色々調べていたらライブラリの初期値が黒とグレイでした、、
178
+
179
+ このデフォルト値をOverrideでnilに出来ますでしょうか?
180
+
181
+ 自分がやったこととしてはtintColorDidChange()を使って変更しようとしてもnilが渡せませんでした。
182
+
183
+
184
+
185
+ 上記が関係しているかは、分かりませんがどんな意見でもいいのでご教授いただければと思います。

1

情報修正

2020/08/12 09:42

投稿

ludolf
ludolf

スコア39

test CHANGED
File without changes
test CHANGED
@@ -68,95 +68,81 @@
68
68
 
69
69
 
70
70
 
71
- func viewDidLoadNavigation() {
71
+ func viewDidLoadNavigation() {
72
72
 
73
73
 
74
74
 
75
- var registerIcon = UIImage(named: "register_icon")?.withRenderingMode(.alwaysOriginal)
75
+ let size = bottomNavBar.sizeThatFits(view.bounds.size)
76
76
 
77
77
 
78
78
 
79
- if let image = registerIcon {
79
+ let bottomNavBarFrame = CGRect(x: 0,y: view.bounds.height - size.height,width: size.width,height: size.height)
80
80
 
81
- let renderedImage = image.withRenderingMode(.alwaysOriginal)
81
+
82
82
 
83
-
83
+ bottomNavBar.frame = bottomNavBarFrame
84
84
 
85
- let size = bottomNavBar.sizeThatFits(view.bounds.size)
85
+
86
86
 
87
-
87
+ let homeItem = UITabBarItem(
88
88
 
89
- let bottomNavBarFrame = CGRect(x: 0,y: view.bounds.height - size.height,width: size.width,height: size.height)
89
+ title: "Home",
90
90
 
91
-
91
+ image: UIImage(icon: .googleMaterialDesign(.home), size: CGSize(width: 40, height: 40)),
92
92
 
93
- bottomNavBar.frame = bottomNavBarFrame
93
+ tag: 0)
94
94
 
95
-
95
+ let messagesItem = UITabBarItem(
96
96
 
97
- let homeItem = UITabBarItem(
97
+ title: "問題の画像",
98
98
 
99
- title: "Home",
99
+ image: UIImage(named: "register_icon")?.withRenderingMode(.alwaysOriginal),
100
100
 
101
- image: UIImage(icon: .googleMaterialDesign(.home), size: CGSize(width: 40, height: 40)),
101
+ tag: 1)
102
102
 
103
- tag: 0)
103
+ messagesItem.badgeValue = "8"
104
104
 
105
- let messagesItem = UITabBarItem(
105
+ let favoritesItem = UITabBarItem(
106
106
 
107
- title: "表示されない画像",
107
+ title: "Favorites",
108
108
 
109
- image: UIImage(named: "register_icon")?.withRenderingMode(.alwaysOriginal),
109
+ image: UIImage(icon: .fontAwesome(.starO), size: CGSize(width: 40, height: 40)),
110
110
 
111
- tag: 0)
111
+ tag: 2)
112
112
 
113
- messagesItem.badgeValue = "8"
113
+ favoritesItem.badgeValue = ""
114
114
 
115
- let favoritesItem = UITabBarItem(
115
+ let readerItem = UITabBarItem(
116
116
 
117
- title: "Favorites",
117
+ title: "Reader",
118
118
 
119
- image: UIImage(icon: .fontAwesome(.starO), size: CGSize(width: 40, height: 40)),
119
+ image: UIImage(icon: .fontAwesome(.signIn), size: CGSize(width:40, height: 40)),
120
120
 
121
- tag: 0)
121
+ tag: 3)
122
122
 
123
- favoritesItem.badgeValue = ""
124
-
125
- let readerItem = UITabBarItem(
126
-
127
- title: "Reader",
128
-
129
- image: UIImage(icon: .fontAwesome(.signIn), size: CGSize(width:40, height: 40)),
130
-
131
- tag: 0)
132
-
133
- readerItem.badgeValue = "88"
123
+ readerItem.badgeValue = "88"
134
124
 
135
125
 
136
126
 
137
- let birthdayItem = UITabBarItem(
127
+ let birthdayItem = UITabBarItem(
138
128
 
139
- title: "ic_birthday",
129
+ title: "ic_birthday",
140
130
 
141
- image: UIImage(icon: .googleMaterialDesign(.accountCircle), size: CGSize(width:40, height: 40)),
131
+ image: UIImage(icon: .googleMaterialDesign(.accountCircle), size: CGSize(width:40, height: 40)),
142
132
 
143
- tag: 0)
133
+ tag: 4)
144
134
 
145
- birthdayItem.badgeValue = "888+"
135
+ birthdayItem.badgeValue = "888+"
146
136
 
147
- bottomNavBar.items = [homeItem, messagesItem, favoritesItem, readerItem, birthdayItem]
137
+ bottomNavBar.items = [homeItem, messagesItem, favoritesItem, readerItem, birthdayItem]
148
138
 
149
- bottomNavBar.selectedItem = homeItem
139
+ bottomNavBar.selectedItem = homeItem
150
-
151
-
152
-
153
- view.addSubview(bottomNavBar)
154
-
155
- }
156
140
 
157
141
 
158
142
 
159
-
143
+ view.addSubview(bottomNavBar)
144
+
145
+
160
146
 
161
147
  }
162
148