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

質問編集履歴

2

情報追加

2020/08/12 09:42

投稿

ludolf
ludolf

スコア39

title CHANGED
File without changes
body CHANGED
@@ -79,4 +79,15 @@
79
79
  実際の画面
80
80
  ![イメージ説明](d6d132ef91d09bf4abf741314c2068f6.png)
81
81
 
82
- よろしくお願いします!
82
+ よろしくお願いします!
83
+
84
+
85
+ ### 追記
86
+
87
+ ![イメージ説明](a9a74d980f4817538715b53d16048a01.png)
88
+
89
+ ずっと黒・グレイでitemが表示されていたので、tintColorが悪さしてるんじゃないかと思って色々調べていたらライブラリの初期値が黒とグレイでした、、
90
+ このデフォルト値をOverrideでnilに出来ますでしょうか?
91
+ 自分がやったこととしてはtintColorDidChange()を使って変更しようとしてもnilが渡せませんでした。
92
+
93
+ 上記が関係しているかは、分かりませんがどんな意見でもいいのでご教授いただければと思います。

1

情報修正

2020/08/12 09:42

投稿

ludolf
ludolf

スコア39

title CHANGED
File without changes
body CHANGED
@@ -33,51 +33,44 @@
33
33
 
34
34
  }
35
35
 
36
- func viewDidLoadNavigation() {
36
+ func viewDidLoadNavigation() {
37
37
 
38
- var registerIcon = UIImage(named: "register_icon")?.withRenderingMode(.alwaysOriginal)
38
+ let size = bottomNavBar.sizeThatFits(view.bounds.size)
39
39
 
40
- if let image = registerIcon {
41
- let renderedImage = image.withRenderingMode(.alwaysOriginal)
42
-
43
- let size = bottomNavBar.sizeThatFits(view.bounds.size)
44
-
45
- let bottomNavBarFrame = CGRect(x: 0,y: view.bounds.height - size.height,width: size.width,height: size.height)
40
+ let bottomNavBarFrame = CGRect(x: 0,y: view.bounds.height - size.height,width: size.width,height: size.height)
46
-
41
+
47
- bottomNavBar.frame = bottomNavBarFrame
42
+ bottomNavBar.frame = bottomNavBarFrame
48
-
43
+
49
- let homeItem = UITabBarItem(
44
+ let homeItem = UITabBarItem(
50
- title: "Home",
45
+ title: "Home",
51
- image: UIImage(icon: .googleMaterialDesign(.home), size: CGSize(width: 40, height: 40)),
46
+ image: UIImage(icon: .googleMaterialDesign(.home), size: CGSize(width: 40, height: 40)),
52
- tag: 0)
47
+ tag: 0)
53
- let messagesItem = UITabBarItem(
48
+ let messagesItem = UITabBarItem(
54
- title: "表示されない画像",
49
+ title: "問題の画像",
55
- image: UIImage(named: "register_icon")?.withRenderingMode(.alwaysOriginal),
50
+ image: UIImage(named: "register_icon")?.withRenderingMode(.alwaysOriginal),
56
- tag: 0)
51
+ tag: 1)
57
- messagesItem.badgeValue = "8"
52
+ messagesItem.badgeValue = "8"
58
- let favoritesItem = UITabBarItem(
53
+ let favoritesItem = UITabBarItem(
59
- title: "Favorites",
54
+ title: "Favorites",
60
- image: UIImage(icon: .fontAwesome(.starO), size: CGSize(width: 40, height: 40)),
55
+ image: UIImage(icon: .fontAwesome(.starO), size: CGSize(width: 40, height: 40)),
61
- tag: 0)
56
+ tag: 2)
62
- favoritesItem.badgeValue = ""
57
+ favoritesItem.badgeValue = ""
63
- let readerItem = UITabBarItem(
58
+ let readerItem = UITabBarItem(
64
- title: "Reader",
59
+ title: "Reader",
65
- image: UIImage(icon: .fontAwesome(.signIn), size: CGSize(width:40, height: 40)),
60
+ image: UIImage(icon: .fontAwesome(.signIn), size: CGSize(width:40, height: 40)),
66
- tag: 0)
61
+ tag: 3)
67
- readerItem.badgeValue = "88"
62
+ readerItem.badgeValue = "88"
68
63
 
69
- let birthdayItem = UITabBarItem(
64
+ let birthdayItem = UITabBarItem(
70
- title: "ic_birthday",
65
+ title: "ic_birthday",
71
- image: UIImage(icon: .googleMaterialDesign(.accountCircle), size: CGSize(width:40, height: 40)),
66
+ image: UIImage(icon: .googleMaterialDesign(.accountCircle), size: CGSize(width:40, height: 40)),
72
- tag: 0)
67
+ tag: 4)
73
- birthdayItem.badgeValue = "888+"
68
+ birthdayItem.badgeValue = "888+"
74
- bottomNavBar.items = [homeItem, messagesItem, favoritesItem, readerItem, birthdayItem]
69
+ bottomNavBar.items = [homeItem, messagesItem, favoritesItem, readerItem, birthdayItem]
75
- bottomNavBar.selectedItem = homeItem
70
+ bottomNavBar.selectedItem = homeItem
76
-
77
- view.addSubview(bottomNavBar)
78
- }
79
71
 
80
-
72
+ view.addSubview(bottomNavBar)
73
+
81
74
  }
82
75
 
83
76